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

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.

主站蜘蛛池模板: 天等县| 潼关县| 德令哈市| 禄丰县| 静宁县| 湄潭县| 井冈山市| 丰顺县| 合川市| 磐石市| 越西县| 宝丰县| 青河县| 上栗县| 岐山县| 鄢陵县| 富平县| 呼伦贝尔市| 江永县| 繁峙县| 泸溪县| 昭平县| 凤翔县| 定边县| 西藏| 乐平市| 望城县| 集贤县| 千阳县| 西吉县| 仙桃市| 绥宁县| 萍乡市| 元氏县| 会泽县| 蚌埠市| 大余县| 铁力市| 常熟市| 凯里市| 安乡县|