当前位置:Gxlcms > JavaScript > cssbox-direction属性怎么用

cssbox-direction属性怎么用

时间:2021-07-01 10:21:17 帮助过:63人阅读

css box-direction属性用于定义框元素的子元素以什么方向来排列,其语法是box-direction: normal|reverse|inherit,normal以默认方向显示子元素。

css box-direction属性怎么用?

作用:定义框元素的子元素以什么方向来排列。

语法:

  1. box-direction: normal|reverse|inherit;

说明:

normal以默认方向显示子元素。reverse以反方向显示子元素。inherit应该从子元素继承 box-direction 属性的值

注释:

目前没有浏览器支持 box-direction 属性。Firefox 支持替代的 -moz-box-direction 属性。Safari、Opera 以及 Chrome 支持替代的 -webkit-box-direction 属性。

css box-direction属性使用示例

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. div
  6. {
  7. width:350px;
  8. height:100px;
  9. border:1px solid black;
  10. /* Firefox */
  11. display:-moz-box;
  12. -moz-box-direction:reverse;
  13. /* Safari, Opera, and Chrome */
  14. display:-webkit-box;
  15. -webkit-box-direction:reverse;
  16. /* W3C */
  17. display:box;
  18. box-direction:reverse;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <div>
  24. <p>段落 1。</p>
  25. <p>段落 2。</p>
  26. <p>段落 3。</p>
  27. </div>
  28. <p><b>注释:</b>IE 不支持 box-direction 属性。</p>
  29. </body>
  30. </html>

效果输出:

55d36ebd068c905b7fbcb90af753f18.png

以上就是css box-direction属性怎么用的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行