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

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;
}
主站蜘蛛池模板: 保亭| 岳阳县| 林口县| 慈利县| 苍山县| 建水县| 新龙县| 兴安县| 乳山市| 洛阳市| 花垣县| 金寨县| 宁蒗| 竹溪县| 忻州市| 遵义市| 宁国市| 雷山县| 平定县| 云阳县| 如东县| 巴南区| 赞皇县| 鹰潭市| 离岛区| 五大连池市| 高尔夫| 凤山县| 望城县| 安康市| 沙河市| 马边| 吐鲁番市| 抚顺市| 平定县| 托克逊县| 库尔勒市| 古浪县| 曲麻莱县| 台北市| 萨迦县|