Flexbox 百分比布局

2018-01-02 14:10:00
admin
原创
611
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Flexbox 百分比布局</title>
	
	<style>
.Grid {
  display: flex;
}

.Grid-cell {
  flex: 1;
  border:1px solid red;
}

.Grid-cell.u-full {
  flex: 0 0 100%;
}

.Grid-cell.u-1of2 {
  flex: 0 0 50%;
}

.Grid-cell.u-1of3 {
  flex: 0 0 33.3333%;
}

.Grid-cell.u-1of4 {
  flex: 0 0 25%;
}
	</style>
</head>

<body >
<div class="Grid">
  <div class="Grid-cell u-1of4">1</div>
  <div class="Grid-cell">2</div>
  <div class="Grid-cell u-1of3">3</div>
</div>
</body>

</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络