- Bootstrap 4:Responsive Web Design
- Silvio Moreto Matt Lambert Benjamin Jakobus Jason Marah
- 140字
- 2021-07-09 18:54:47
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; }
- 多媒體CAI課件設(shè)計(jì)與制作導(dǎo)論(第二版)
- Android項(xiàng)目開發(fā)入門教程
- 深入淺出Electron:原理、工程與實(shí)踐
- Learning ArcGIS Pro 2
- Python自動(dòng)化運(yùn)維快速入門
- Vue.js 3.0源碼解析(微課視頻版)
- Python王者歸來
- SQL Server 2016數(shù)據(jù)庫應(yīng)用與開發(fā)習(xí)題解答與上機(jī)指導(dǎo)
- Android開發(fā)案例教程與項(xiàng)目實(shí)戰(zhàn)(在線實(shí)驗(yàn)+在線自測)
- Python數(shù)據(jù)結(jié)構(gòu)與算法(視頻教學(xué)版)
- Python機(jī)器學(xué)習(xí)算法: 原理、實(shí)現(xiàn)與案例
- Solr Cookbook(Third Edition)
- Unity 3D腳本編程:使用C#語言開發(fā)跨平臺(tái)游戲
- Modular Programming with JavaScript
- IBM RUP參考與認(rèn)證指南