<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> *{ margin: 0; padding: 0; } .box{ width: 100%; height: 200px; border: 1px solid #ccc; } .box_box{ height: 100%; background: #FF4400; float: left; width: ;/*我想把每个div的宽都设成1/6的宽度,怎么写?*/ } </style> </head> <body> <div class="box"> <div class="box_box"></div> <div class="box_box"></div> <div class="box_box"></div> <div class="box_box"></div> <div class="box_box"></div> <div class="box_box"></div> </div> </body></html>
1 回答
已采纳
情若自控3943916
TA贡献12条经验 获得超3个赞
*{
margin: 0;
padding: 0;
}
.box{
display: flex;
width: 100%;
height: 200px;
border: 1px solid #ccc;
}
.box_box{
flex: 1;
height: 100%;
background: #ffe9e0;
float: left;
margin-right: 5px;
}
.box_box:last-child{
margin-right: 0px;
}
css部分,其余没动
添加回答
举报
0/150
提交
取消