Flex 布局

博客围绕CSS展开,但具体内容缺失,推测可能涉及CSS的各类特性、应用场景等信息技术相关内容。
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>flex</title>
	<style>
		body,html{
			margin: 0;
			padding: 0;
		}
		/*
			-----box-----
			flex-direction: row| row-reverse | column | column-reverse;
			flex-wrap: nowrap | wrap | wrap-reverse;
			flex-flow: row nowrap;   <flex-direction><flex-wrap>
			justify-content: flex-start | flex-end | center | space-between | space-around;
			align-items: flex-start | flex-end | center | baseline | stretch;
			align-content: flex-start | flex-end | center | space-between | space-around | stretch;
		*/
		/*
			-----item----
			order: <integer> | 0; //项目的排列顺序,数值越小,排列越靠前,默认为0
			flex-grow: <number> | 0; //项目的放大比例,如果存在剩余空间,也不这大。
			flex-shrink: <number> | 1; //项目的缩小比例,如果空间不足,该项目将缩小。
			flex-basis: <length> | auto; //在分配多余空间之前,项目占据的主轴空间。浏览器根据这个属性,计算主轴是否有多余空间。auto 项目的本来大小。
			flex: none | [<'flex-grow'><'flex-shrink'> ? || <'flex-basis'>];
			align-self: auto | flex-start | flex-end | center | baseline | stretch;
		*/
		.box{
			width: 80%;
			margin: 0 auto;
			background: #000;
			display: flex;
			/*flex-direction: row-reverse;*/
			/*-webkit-flex-direction: column-reverse;
			-moz-flex-direction: column-reverse;
			-ms-flex-direction: column-reverse;
			-o-flex-direction: column-reverse;
			flex-direction: column-reverse;*/
			/*flex-wrap: wrap-reverse;*/
			justify-content: space-between;
			align-items: baseline;
			align-content: center;
		}
		.boxPub{
			width: 100px;
			/*height: 100px;*/
			text-align: center;
		}
		.box1{
			background-color: pink;
			height: 50px;
		}
		.box2{
			background-color: red;
			height: 100px;
		}
		.box3{
			background-color: green;
			height: 180px;
		}
		.box4{
			background-color: orange;
			height: 200px;
		}
	</style>
</head>
<body>
	<div class="box">
		<div class="boxPub box1">aade rwefs vvwjkluyib</div>
		<div class="boxPub box2">btuyfnd asfwr fasfrt fgyt</div>
		<div class="boxPub box3">cadf ew adfe wfa</div>
		<div class="boxPub box4">d234 afwe af fa afa</div>
	</div>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值