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

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.

主站蜘蛛池模板: 安宁市| 隆昌县| 雷波县| 获嘉县| 定兴县| 泸定县| 师宗县| 厦门市| 屯门区| 文水县| 海口市| 宁波市| 八宿县| 嘉义县| 阜宁县| 黑水县| 石嘴山市| 凤翔县| 阜新市| 专栏| 兰溪市| 常德市| 新营市| 晋中市| 平乐县| 中卫市| 弥渡县| 澜沧| 黄山市| 上杭县| 遂平县| 新建县| 乌拉特后旗| 叙永县| 怀宁县| 黑龙江省| 江山市| 南宫市| 澄迈县| 伊川县| 哈尔滨市|