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

Creating a multicolumn layout

Floats were designed to flow text around an image. However, floats are also the most common way of building a multicolumn layout. In this section, we'll look at how to float elements next to each other in order to create a page layout.

So, what we currently have in the HTML in the secondary section are three div tags with a class of column:

The following screenshot illustrates the final site. This is what we're aiming for. We want three equal columns with a small gutter or margin in between:

In our current site, columns are stacked on top of one another. Right now, we have simple rows, so we want to fix that using floats. In our final site, we want to have everything centered in the middle of the page, but right now, all of our content goes from one edge of the browser window to pretty much the opposite edge of the browser window:

Let's fix this by centering our div tags.

主站蜘蛛池模板: 上虞市| 承德市| 苍梧县| 双峰县| 高平市| 湘潭县| 荃湾区| 炉霍县| 永年县| 汕头市| 德钦县| 赤峰市| 大余县| 临朐县| 建宁县| 大荔县| 甘南县| 赤壁市| 武汉市| 昭平县| 沙坪坝区| 大兴区| 卢龙县| 高台县| 潼关县| 子长县| 宁远县| 横峰县| 濉溪县| 田林县| 宁德市| 清原| 大渡口区| 宜章县| 明星| 鹤庆县| 清远市| 资溪县| 枣强县| 靖西县| 长岭县|