Home > Article > Web Front-end > Ask God for advice! Thank you_html/css_WEB-ITnose
Wouldn’t it be enough to just add an ID to the first one?
#column1
{
Width:200px;
}
Can’t we just add an ID to the first one?
#column1
{
width:200px;
}
1, 2, 3; the content of the floor
can generate 3 stories
using CSS :first-child selector
1 , 2, 3; the content of the floor
can generate 3 stories
Use CSS :first-child selector
<style type="text/css"> .box{ width:100%; height:100px; background-color:#CCC; /*定义和盒模型*/ display:-webkit-box; } .item{ margin:3px; background-color:#999; /*3列栏目为一个整体盒布局效果*/ box-sizing:border-box; } .item:nth-child(1){ width:200px; } .item:nth-child(2){ /*自适应大小*/ -webkit-box-flex:1; } .item:nth-child(3){ /*自适应大小*/ -webkit-box-flex:1; }</style>