HTML5

1.标准盒子模型
        box-sizing:content-box;
2.IE盒子模型||怪异盒子模型
        box-sizing: border-box;

flex 属性用于指定弹性子元素如何分配空间

flex-direction 属性指定了弹性子元素在父容器中的位置 

lex-direction: row | row-reverse | column | column-reverse
         row横向从左到右排列(左对齐),默认的排列方式。
         row-reverse  反转横向排列(右对齐,从后往前排,最后一项排在最前面。
         column  纵向排列
         column-reverse  反转纵向排列,从后往前排,最后一项排在最上面。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			.box1 {
				width: 300px;
				height: 200px;
				background-color: pink;
				box-sizing: content-box;
			}
			.box2 {
				width: 300px;
				height: 200px;
				padding: 200px;
				background-color: orange;
				box-sizing: border-box;
				/* display: none;
				display: block;
				display: inline;
				display: inline-block;
				display: table; */
			}
			.boss {
				width: 400px;
				height: 200px;
				border: 1px solid red;
				display: flex;
				flex-direction: column;
			}
			.boxx1 {
				width: 100px;
				height: 100px;
				background-color: pink;
				/* flex: 2; */
			}
			.boxx2 {
				width: 100px;
				height: 100px;
				background-color: orange;
				/* flex: 8; */
			}
			.boxx3 {
				width: 100px;
				height: 100px;
				background-color: green;
				/* flex: 2; */
			}
		</style>
	</head>
	<body style="height: 2000px;">
		<!-- 1.标准盒子模型
		box-sizing:content-box;
		2.IE盒子模型||怪异盒子模型
		box-sizing: border-box;
		 -->
		<div class="box1"></div>
		<div class="box2"></div>
		<!-- flex 属性用于指定弹性子元素如何分配空间 -->
		<!-- flex-direction 属性指定了弹性子元素在父容器中的位置 -->
		<!-- flex-direction: row | row-reverse | column | column-reverse
		 row横向从左到右排列(左对齐),默认的排列方式。
		 row-reverse  反转横向排列(右对齐,从后往前排,最后一项排在最前面。
		 column  纵向排列
		 column-reverse  反转纵向排列,从后往前排,最后一项排在最上面。
			-->
		<div class="boss">
			<div class="boxx1">1111111</div>
			<div class="boxx2">2222222</div>
			<div class="boxx3">3333333</div>
		</div>
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值