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

  • Mastering CSS
  • Rich Finelli
  • 169字
  • 2021-07-08 09:45:56

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.

主站蜘蛛池模板: 彭水| 曲沃县| 溧阳市| 普安县| 扶绥县| 桃源县| 全南县| 湾仔区| 乐安县| 凤城市| 辽源市| 佛山市| 青冈县| 余干县| 枞阳县| 河池市| 汉阴县| 阿克陶县| 宣城市| 罗江县| 西藏| 大厂| 西乌珠穆沁旗| 丽江市| 南华县| 加查县| 武义县| 象山县| 江源县| 通城县| 平南县| 三门县| 宜丰县| 光泽县| 霍邱县| 宁晋县| 仲巴县| 上思县| 寿宁县| 英吉沙县| 石阡县|