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

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.

主站蜘蛛池模板: 高州市| 昭通市| 哈尔滨市| 三都| 安西县| 和硕县| 南漳县| 崇州市| 达孜县| 茶陵县| 英吉沙县| 汉中市| 江川县| 徐州市| 新巴尔虎右旗| 闻喜县| 韶山市| 郑州市| 巩留县| 原平市| 甘南县| 禹城市| 元朗区| 西峡县| 乐亭县| 金寨县| 竹溪县| 米林县| 城市| 津市市| 纳雍县| 长阳| 息烽县| 石泉县| 临漳县| 方山县| 尚志市| 壶关县| 莲花县| 佳木斯市| 集安市|