如何在HTML中设置文本方向?


使用dirname属性可以提交文本方向。值将是输入的名称,后跟 “.dir”。

示例

<!DOCTYPE html>
<html>
   <body>
      <h2>Student Contact Form</h2>
      <form action = "mailto:emailid@example.com" method = "post" enctype = "text/plain">
         Student Name:<br><input type = "text" name = "sname" dirname = "sname.dir"> <br>
         Student Subject:<br><input type = "text" name = "ssubject"><br>
         <input type = "submit" value = "Send">
      </form>
   </body>
</html>

更新于: 03-03-2020

173次浏览

开启你的职业

完成本课程并获得认证

开始
广告