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

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.

主站蜘蛛池模板: 龙胜| 沙洋县| 金堂县| 普陀区| 麻城市| 扶余县| 南宫市| 墨竹工卡县| 新竹县| 本溪市| 红河县| 伊川县| 凉城县| 宁强县| 南安市| 庆城县| 桃江县| 临西县| 寿宁县| 连州市| 中西区| 明光市| 盈江县| 白朗县| 嘉定区| 绩溪县| 中山市| 大渡口区| 华蓥市| 横山县| 土默特左旗| 南充市| 贞丰县| 电白县| 瓮安县| 保德县| 台安县| 正镶白旗| 兴和县| 汉源县| 修武县|