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

css box-direction属性怎么用?
作用:定义框元素的子元素以什么方向来排列。
语法:
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属性使用示例
<!DOCTYPE html>
<html>
<head>
<style>
div
{
width:350px;
height:100px;
border:1px solid black;
/* Firefox */
display:-moz-box;
-moz-box-direction:reverse;
/* Safari, Opera, and Chrome */
display:-webkit-box;
-webkit-box-direction:reverse;
/* W3C */
display:box;
box-direction:reverse;
}
</style>
</head>
<body>
<div>
<p>段落 1。</p>
<p>段落 2。</p>
<p>段落 3。</p>
</div>
<p><b>注释:</b>IE 不支持 box-direction 属性。</p>
</body>
</html>效果输出:

以上就是css box-direction属性怎么用的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号