css box-orient属性怎么用

互联网 19-5-28
css box-orient属性用于指定box(框)的子元素是否应按水平或垂直排列。水平框中的子元素从左向右进行显示,而垂直框的子元素从上向下进行显示。

css box-orient属性怎么用?

box-orient属性规定框的子元素是否应水平或垂直排列。

语法:

box-orient: horizontal|vertical|inline-axis|block-axis|inherit;

属性值:

horizontal:在水平行中从左向右排列子元素。

vertical:从上向下垂直排列子元素。

inline-axis:沿着行内轴来排列子元素(映射为 horizontal)。

block-axis:沿着块轴来排列子元素(映射为 vertical)。

inherit:应该从父元素继承 box-orient 属性的值。

说明:水平框中的子元素从左向右进行显示,而垂直框的子元素从上向下进行显示。不过,box-direction 和 box-ordinal-group 能够改变这种顺序。

注:目前所有主流浏览器都不支持box-orient属性。Firefox通过私有属性- MOZ-box-orient支持。Safari, Opera, 和 Chrome通过私有属性 -webkit-box-orient 支持。

css box-orient属性 示例

<!DOCTYPE html> <html>  	<head> 		<meta charset="UTF-8"> 		<style> 			div { 				width: 350px; 				height: 150px; 				border: 1px solid black; 				/* Firefox */ 				display: -moz-box; 				-moz-box-orient: horizontal; 				/* Safari, Opera, and Chrome */ 				display: -webkit-box; 				-webkit-box-orient: horizontal; 				/* W3C */ 				display: box; 				box-orient: horizontal; 			} 		</style> 	</head>  	<body>  		<div> 			<p>段落 1。</p> 			<p>段落 2。</p> 			<p>段落 3。</p> 		</div>  		<p><b>注释:</b>IE 不支持 box-orient 属性。</p>  	</body>  </html>

以上就是css box-orient属性怎么用的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: box-orient属性
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:css clear属性怎么用

相关资讯