頁(yè)面布局 - Layout

固定布局

.container 類用于固定寬度并支持響應(yīng)式布局的容器创南。注意票渠,由于 padding 等屬性的原因庵朝,這兩種 容器類不能互相嵌套拂檩。

<!-- 導(dǎo)航條部分 -->
<nav id="myNavbar" class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Tutorial Republic</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="nav navbar-nav">
                <li class="active"><a  target="_blank">首頁(yè)</a></li>
                <li><a  target="_blank">關(guān)于</a></li>
                <li><a  target="_blank">聯(lián)系</a></li>
            </ul>
        </div>
    </div>
</nav>


<!-- 主體布局容器 -->
<div class="container">

    <!-- 巨幕部分 -->
    <div class="jumbotron">
        <h1>學(xué)習(xí)如何創(chuàng)建網(wǎng)頁(yè)</h1>
        <p>In today's world internet is the most popular way of connecting with the people. At <a  target="_blank">tutorialrepublic.com</a> you will learn the essential of web development technologies along with real life practice example, so that you can create your own website to connect with the people around the world.</p>
        <p><a  target="_blank" class="btn btn-success btn-lg">立即開始</a></p>
    </div>

    <!-- 三分列簡(jiǎn)介 -->
    <div class="row">
        <div class="col-xs-4">
            <h2>HTML</h2>
            <p>HTML is a markup language that is used for creating web pages. The HTML tutorial section will help you understand the basics of HTML, so that you can create your own web pages or website.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="col-xs-4">
            <h2>CSS</h2>
            <p>CSS is used for describing the presentation of web pages. The CSS tutorial section will help you learn the essentials of CSS, so that you can fine control the style and layout of your HTML document.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="col-xs-4">
            <h2>Bootstrap</h2>
            <p>Bootstrap is a powerful front-end framework for faster and easier web development. The Bootstrap tutorial section will help you learn the techniques of Bootstrap so that you can quickly create your own website.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
    </div>

    <!-- 頁(yè)腳 -->
    <hr>
    <div class="row">
        <div class="col-xs-12">
            <footer>
                <p>? Copyright 2013 Tutorial Republic</p>
            </footer>
        </div>
    </div>
</div>

01.PNG

流式布局

100% 寬度侮腹,占據(jù)全部視口(viewport)的容器嘲碧。

<!-- 導(dǎo)航條 -->
<nav id="myNavbar" class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Tutorial Republic</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="nav navbar-nav">
                <li class="active"><a  target="_blank">Home</a></li>
                <li><a  target="_blank">About</a></li>
                <li><a  target="_blank">Contact</a></li>
            </ul>
        </div>
    </div>
</nav>


<!-- 流式布局巨幕 -->
<div class="jumbotron">
    <div class="container-fluid">
        <h1>Learn to Create Websites</h1>
        <p>In today's world internet is the most popular way of connecting with the people. At <a  target="_blank">tutorialrepublic.com</a> you will learn the essential of web development technologies along with real life practice example, so that you can create your own website to connect with the people around the world.</p>
        <p><a  target="_blank" class="btn btn-success btn-lg">Get started today</a></p>
    </div>
</div>


<!-- 流式布局主體 -->
<div class="container-fluid">

    <!-- 三列 -->
    <div class="row">
        <div class="col-xs-4">
            <h2>HTML</h2>
            <p>HTML is a markup language that is used for creating web pages. The HTML tutorial section will help you understand the basics of HTML, so that you can create your own web pages or website.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="col-xs-4">
            <h2>CSS</h2>
            <p>CSS is used for describing the presentation of web pages. The CSS tutorial section will help you learn the essentials of CSS, so that you can fine control the style and layout of your HTML document.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="col-xs-4">
            <h2>Bootstrap</h2>
            <p>Bootstrap is a powerful front-end framework for faster and easier web development. The Bootstrap tutorial section will help you learn the techniques of Bootstrap so that you can create web your own website.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
    </div>

    <!-- 版權(quán)信息 -->
    <hr>
    <div class="row">
        <div class="col-xs-12">
            <footer>
                <p>? Copyright 2013 Tutorial Republic</p>
            </footer>
        </div>
    </div>
</div>
02.PNG

響應(yīng)式布局

行列數(shù)目根據(jù)屏幕大小自動(dòng)調(diào)整

<!-- 導(dǎo)航條部分 -->
<nav id="myNavbar" class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Tutorial Republic</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="nav navbar-nav">
                <li class="active"><a  target="_blank">Home</a></li>
                <li><a  target="_blank">About</a></li>
                <li><a  target="_blank">Contact</a></li>
            </ul>
        </div>
    </div>
</nav>

<!-- 固定寬度布局 -->
<div class="container">

    <!-- 巨幕 -->
    <div class="jumbotron">
        <h1>Learn to Create Websites</h1>
        <p>In today's world internet is the most popular way of connecting with the people. At <a  target="_blank">tutorialrepublic.com</a> you will learn the essential of web development technologies along with real life practice example, so that you can create your own website to connect with the people around the world.</p>
        <p><a  target="_blank" class="btn btn-success btn-lg">Get started today</a></p>
    </div>

    <!-- 響應(yīng)式一行多列 -->
    <div class="row">
        <div class="col-sm-6 col-md-4 col-lg-2">
            <h2>HTML</h2>
            <p>HTML is a markup language that is used for creating web pages. The HTML tutorial section will help you understand the basics of HTML, so that you can create your own web pages or website.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="col-sm-6 col-md-4 col-lg-2">
            <h2>CSS</h2>
            <p>CSS is used for describing the presentation of web pages. The CSS tutorial section will help you learn the essentials of CSS, so that you can fine control the style and layout of your HTML document.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="clearfix visible-sm-block"></div>
        <div class="col-sm-6 col-md-4 col-lg-2">
            <h2>Bootstrap</h2>
            <p>Bootstrap is a powerful front-end framework for faster and easier web development. The Bootstrap tutorial section will help you learn the techniques of Bootstrap so that you can create web your own website with much less efforts.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="clearfix visible-md-block"></div>
        <div class="col-sm-6 col-md-4 col-lg-2">
            <h2>References</h2>
            <p>The references section outlines all the standard HTML tags and CSS properties along with other useful references such as color names and values, symbols and character entities, web safe fonts, language codes, HTTP messages and much more.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="clearfix visible-sm-block"></div>
        <div class="col-sm-6 col-md-4 col-lg-2">
            <h2>Examples</h2>
            <p>The examples section encloses an extensive collection of examples on various topic that you can try and test yourself using online HTML editor.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
        <div class="col-sm-6 col-md-4 col-lg-2">
            <h2>FAQ</h2>
            <p>The collection of Frequently Asked Questions (FAQ) provides brief answers to many common questions related to web design and development.</p>
            <p><a  target="_blank" class="btn btn-success">Learn More ?</a></p>
        </div>
    </div>

    <!-- 頁(yè)腳 -->
    <hr>
    <div class="row">
        <div class="col-sm-12">
            <footer>
                <p>? Copyright 2013 Tutorial Republic</p>
            </footer>
        </div>
    </div>
</div>

03.PNG
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末稻励,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子愈涩,更是在濱河造成了極大的恐慌望抽,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,941評(píng)論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件履婉,死亡現(xiàn)場(chǎng)離奇詭異煤篙,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)毁腿,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,397評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門辑奈,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人已烤,你說我怎么就攤上這事鸠窗。” “怎么了胯究?”我有些...
    開封第一講書人閱讀 165,345評(píng)論 0 356
  • 文/不壞的土叔 我叫張陵稍计,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我裕循,道長(zhǎng)臣嚣,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,851評(píng)論 1 295
  • 正文 為了忘掉前任剥哑,我火速辦了婚禮硅则,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘株婴。我一直安慰自己怎虫,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,868評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著揪垄,像睡著了一般穷吮。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上饥努,一...
    開封第一講書人閱讀 51,688評(píng)論 1 305
  • 那天捡鱼,我揣著相機(jī)與錄音,去河邊找鬼酷愧。 笑死驾诈,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的溶浴。 我是一名探鬼主播乍迄,決...
    沈念sama閱讀 40,414評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼士败!你這毒婦竟也來(lái)了闯两?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,319評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤谅将,失蹤者是張志新(化名)和其女友劉穎漾狼,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體饥臂,經(jīng)...
    沈念sama閱讀 45,775評(píng)論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡逊躁,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,945評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了隅熙。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片稽煤。...
    茶點(diǎn)故事閱讀 40,096評(píng)論 1 350
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖囚戚,靈堂內(nèi)的尸體忽然破棺而出酵熙,到底是詐尸還是另有隱情,我是刑警寧澤弯淘,帶...
    沈念sama閱讀 35,789評(píng)論 5 346
  • 正文 年R本政府宣布绿店,位于F島的核電站,受9級(jí)特大地震影響庐橙,放射性物質(zhì)發(fā)生泄漏假勿。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,437評(píng)論 3 331
  • 文/蒙蒙 一态鳖、第九天 我趴在偏房一處隱蔽的房頂上張望转培。 院中可真熱鬧,春花似錦浆竭、人聲如沸浸须。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,993評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)删窒。三九已至裂垦,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間肌索,已是汗流浹背蕉拢。 一陣腳步聲響...
    開封第一講書人閱讀 33,107評(píng)論 1 271
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留诚亚,地道東北人晕换。 一個(gè)月前我還...
    沈念sama閱讀 48,308評(píng)論 3 372
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像站宗,于是被迫代替她去往敵國(guó)和親闸准。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,037評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容