CSS Flex布局-等分布局
html公开前 25 行,完整代码需登录
<style>
.flex {
display: flex;
background-color: #e8e8e8;
min-height: 150px;
}
.flex-item {
flex: 1;
height: 100px;
background-color: #2196F3;
border: 1px solid #000;
color: white;
font-size: 24px;
font-weight: bold;
text-align: center;
margin: 0 5px;
}
.flex-item:first-child {
margin-left: 0;
}
.flex-item:last-child {
margin-right: 0;
}
</style>
<div class="flex">