- HTML中文网
- 联系QQ:88526
- QQ交流群

- 微信公众号

direction属性
含义及用法:
direction属性指定文本方向/书写方向
默认值: | ltr |
继承: | yes |
版本: | CSS2 |
JavaScript 语法: | object.style.direction="rtl" |
浏览器支持:
属性 | ![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|---|
direction | 5.5 | 2.0 | 1.0 | 1.3 | 9.2 |
CSS语法:
direction:ltr|rtl|inherit;
属性值:
值 | 描述 |
ltr | 默认,文本方向从左到右。 |
rtl | 文本方向从右到左。 |
inherit | 规定应该从父元素继承 direction 属性的值。 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> .demo {direction:rtl;} </style> </head> <body> <div>文本默认的书写方向</div> <div class="demo">设置文本从右到左的方向</div> </body> </html>
点击 "运行实例" 按钮查看在线实例
效果图:
推荐手册