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

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;
}
主站蜘蛛池模板: 孙吴县| 育儿| 中牟县| 罗山县| 开江县| 刚察县| 万载县| 清水河县| 韶山市| 色达县| 肇东市| 贵德县| 蓝山县| 舒兰市| 大理市| 西林县| 同江市| 安塞县| 舞阳县| 连山| 望奎县| 松滋市| 芦山县| 宜良县| 汽车| 宁远县| 博兴县| 肇庆市| 察隅县| 喀什市| 宁武县| 金湖县| 永康市| 临湘市| 唐河县| 敦煌市| 城市| 罗甸县| 慈溪市| 东乡| 翼城县|