官术网_书友最值得收藏!

Solving the problems of floats

Okay, so let's look at our problem. You've learned how to change stacked rows into horizontal columns in order to achieve a multicolumn layout, but our containing element around our floated elements has totally collapsed and lost its height because all the elements inside it are floated. As a collapsed element, it doesn't look like it's responding to the margin-bottom property or the background-color we've assigned to it. So, in this section, we'll look at four separate methods to fix this collapse, and we'll try to understand the best way to deal with it. First, we'll use the clear method, followed by the overflow: hidden method, followed by the float method, and then finally the most preferred method: the clearfix hack.

主站蜘蛛池模板: 西昌市| 永丰县| 思茅市| 福建省| 德庆县| 马山县| 武冈市| 台前县| 长治市| 新营市| 城固县| 湾仔区| 云浮市| 宝山区| 荃湾区| 利津县| 沙雅县| 常山县| 汪清县| 札达县| 北海市| 原平市| 宁南县| 丹寨县| 太仆寺旗| 天气| 曲靖市| 平遥县| 宜章县| 湟源县| 互助| 合肥市| 顺昌县| 潮安县| 普定县| 遵化市| 晋城| 长治市| 桃江县| 田林县| 水城县|