![](https://img.haomeiwen.com/i17903226/e41a93c0b2130da0.png)
float布局
- 步骤
- 子元素上加 float:left 和 width
- 在父元素上加 .clearfix(重要)
content: '';
display: block;
clear: both;
}
![](https://img.haomeiwen.com/i17903226/19b4716efa1b85e0.png)
-
border调试时可能会干扰布局,这时可以用outline替代。
-
块级元素且宽度固定,如果要居中:
margin:0 atuto;
margin-left:auto; margin-right:auto;
更好
content: '';
display: block;
clear: both;
}
border调试时可能会干扰布局,这时可以用outline替代。
块级元素且宽度固定,如果要居中:
margin:0 atuto;
margin-left:auto; margin-right:auto;
更好
本文标题:CSS布局
本文链接:https://www.haomeiwen.com/subject/jgspxktx.html
网友评论