css实现多个div自适应高度(一样高)
效果展示:
源码展示:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>css实现多个div自适应高度(一样高)</title>
<style>
.box-block {
display: table;
width: 100%;
}
.box-block div {
display: table-cell;
word-wrap: break-word;
width: 33.33%;
text-align: center;
padding: 10px;
}
.box1 {
background-color: #FF7800;
}
.box2 {
background-color: #028E9B;
}
.box3 {
background-color: #FFAD00;
}
</style>
</head>
<body>
<div class="box-block">
<div class="box1">盒子1</div>
<div class="box2">
盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2盒子2
</div>
<div class="box3">盒子3</div>
</div>
<hr>
<pre style="color:red">
感: 最近贡献一下我在教学中的小案例可以能给你一些帮助 ,希望继续关注我的博客
--王
</pre>
</body>
</html>