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

  • 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.

主站蜘蛛池模板: 虹口区| 沈阳市| 兴义市| 巴青县| 永康市| 景泰县| 洪雅县| 长宁区| 阳春市| 平陆县| 青岛市| 金昌市| 阿鲁科尔沁旗| 贡山| 温州市| 临桂县| 咸阳市| 逊克县| 江源县| 阳曲县| 长乐市| 渝北区| 平塘县| 桃园市| 车险| 从江县| 兴业县| 儋州市| 西安市| 普兰县| 大英县| 云南省| 山西省| 西乡县| 镇康县| 洞口县| 淮北市| 石泉县| 耒阳市| 屏南县| 萍乡市|