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

Do a grid again

We have finally finished the navigation bar. Now it's time to the page main content. For that, we must create a page grid. Following how Twitter uses a three-column-based layout, we will do the same. The HTML code for the scaffolding is the one that should be placed after the <nav> element:

<div class="container">
  <div class="row">
    <div id="profile" class="col-md-3 hidden-sm hidden-xs"></div>
    <div id="main" class="col-sm-12 col-md-6"> </div>
    <div id="right-content" class="col-md-3 hidden-sm hidden-xs"> </div>
  </div>
</div>

To understand it, we just created a .container with a single .row. The .row contains three columns, the first and the last being visible only for medium and larger devices. This is because of the .hidden-sm and .hidden-xs classes. When both columns are hidden, the middle column fills the row completely. This is because of the .col-sm-12 class.

To finish that, add a padding-top to <body> in order to correct the page's position with respect to the navigation bar:

body {
  padding-top: 4em;
  background-color: #F5F8FA;
}
主站蜘蛛池模板: 巴中市| 贵州省| 阳山县| 永仁县| 贵港市| 柘城县| 上高县| 安泽县| 和平区| 炎陵县| 平乡县| 漳州市| 永清县| 封丘县| 乌拉特前旗| 洪洞县| 荆州市| 白银市| 黎川县| 巴青县| 南皮县| 遵化市| 庆云县| 贵南县| 巴林右旗| 巨野县| 锡林郭勒盟| 七台河市| 衡阳县| 武宣县| 全州县| 玉林市| 防城港市| 蒙山县| 南漳县| 兴化市| 肥乡县| 静海县| 高清| 定结县| 曲松县|