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

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;
}
主站蜘蛛池模板: 崇州市| 尚义县| 双流县| 固安县| 丰镇市| 铜鼓县| 红桥区| 乐业县| 平罗县| 唐山市| 巨野县| 宣威市| 错那县| 天峨县| 台江县| 石楼县| 尤溪县| 南京市| 含山县| 商城县| 林甸县| 军事| 玉山县| 海门市| 根河市| 东丽区| 分宜县| 桃园市| 宜城市| 新兴县| 博兴县| 潢川县| 柳河县| 临清市| 宣武区| 安岳县| 永川市| 武义县| 浦县| 邢台市| 广水市|