<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Terry.Li-彬

    虛其心,可解天下之問;專其心,可治天下之學(xué);靜其心,可悟天下之理;恒其心,可成天下之業(yè)。

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      143 隨筆 :: 344 文章 :: 130 評論 :: 0 Trackbacks

    回顧:Bootstrap的手腳架(Scaffolding)提供了固定(fixed)和流式(fluid)兩種布局,它同時建立了一個寬達940px和12列的格網(wǎng)系統(tǒng)。

    ? ? ? 基于手腳架(Scaffolding)之上,Bootstrap的基礎(chǔ)CSS(Base CSS)提供了一系列的基礎(chǔ)Html頁面要素,旨在為用戶提供新鮮、一致的頁面外觀和感覺。本文將主要深入講解排版(Typography),表格(Table),表單(Forms),按鈕(Buttons)這四個方面的內(nèi)容。

    1. 排版 (Typography) ,它囊括標(biāo)題(Headings),段落 (paragraphs), 列表(lists)以及其他內(nèi)聯(lián)要素。我們可以通過修改variables.less的兩個變量:@baseFontSize?和?@baseLineHeight來控制整體排版的樣式。Bootstrap同時還用了一些其他的算術(shù)方法來創(chuàng)建所有類型要素的margin,padding,line-height等。

    ? ? ? ? 1.1 ? 標(biāo)題和段落使用常見的html<h*></h*>和<p></P>即可表現(xiàn),可以不必考慮margin,padding。兩者顯示效果如圖2-1所示:

    ? ? ? ? ?

    圖2-1 標(biāo)題與段落(Headings&paragraphs)

    ? ? ? 1.2 ?強調(diào)(Emphasis).使用<strong>和<em>兩個標(biāo)簽,前者使用粗體,后者使用斜體來強調(diào)標(biāo)簽內(nèi)容。請注意<strong>標(biāo)簽在html4中定義語氣更重的強調(diào)文本;在 HTML 5 中,<strong> 定義重要的文本。這些短語標(biāo)簽也可以通過定義CSS的方式來豐富效果。更多短語標(biāo)簽請參見[1].縮寫(abbreviations?).使用<abbr>,它重新封裝了該標(biāo)簽,鼠標(biāo)滑過會異步地顯示縮寫的含義。引入title屬性來顯示原文,使用.initialism類對縮寫以大寫方式顯示。

    ? ? ? 1.3 ?引用文字(Blockquotes).使用<blockquote>標(biāo)簽和<small>兩個標(biāo)簽,前者<blockquote>是引用的文字內(nèi)容,后者<small>是可選的要素,能夠添加書寫式的引用,比如內(nèi)容作者。如圖2-2所示

    圖2-2 引用(Blockquotes)

    代碼片段如下所示:

    < div? class ="row" >
    ??
    < div? class ="span6?" >
    ??
    < blockquote? class ="pull-right" >
    ??
    < p > 凌冬將至.?我是黑暗中的利劍,長城上的守衛(wèi),抵御寒冷的烈焰,破曉時分的光線,喚醒眠者的號角,守護王國的堅盾。 </ p >
    ??守夜人軍團總司令.
    < small > 蒙奇.D. < cite? title ="" > 路飛 </ cite ></ small >
    </ blockquote >
    ??
    </ div >
    ??
    < div? class ="span6?" >
    ??
    < blockquote? >
    ??
    < p > 凌冬將至.
    我是黑暗中的利劍,長城上的守衛(wèi),抵御寒冷的烈焰,破曉時分的光線,喚醒眠者的號角,守護王國的堅盾。
    </ p >
    ??守夜人軍團總司令.
    < small > 蒙奇.D. < cite? title ="" > 路飛 </ cite ></ small >
    </ blockquote >
    ??
    </ div >
    ??
    </ div >

    ? ? 1.4列表(lists).Bootstrap提供三種標(biāo)簽來表現(xiàn)不同類型的列表。<ul>表示無序列表,<ul class="unstyled">表示無樣式的無序列表,<ol>表示有序列表,<dl>表示描述列表,<dl class="dl-horizontal">表示豎排描述列表。圖2-3較好顯示了這幾種列表:

    圖2-3 列表(lists)

    ? ? 2.表格(Table).依然使用<table><tr><th><td>等標(biāo)簽來表現(xiàn)表格。主要提供了四個css的類來控制表格的邊和結(jié)構(gòu)。表2-1顯示了bootstrap的table可選項。

    ?

    名字

    Class

    描述

    Default

    None

    沒有樣式,只有行和列

    Basic

    .table

    只有在行間有豎線

    Bordered

    .table-bordered

    圓角和添加外邊框

    Zebra-stripe

    .table-striped

    為奇數(shù)行添加淡灰色的背景色

    Condensed

    .table-condensed

    將橫向的 padding 對切

    ?

    ? ? ? ? ? ? ? 表2-1 表格選項(Table Options)

    ? ? ?我們可以將這些CSS類結(jié)合起來使用,如圖2-4所示,顯示一個混合的表格:

    圖2-4 表格(Table)


    ?

    ? ?3. ?表單(Forms).Bootstrap的表單是非常驚艷的部分。最好的地方在于你如何使用這些hmtl標(biāo)簽,它都會有很好的表現(xiàn)效果,而且不需要其他多余的代碼。無論多復(fù)雜的布局都可以根據(jù)這些簡潔,可擴展,事件綁定的要素來輕易實現(xiàn)。主要提供了四四種表單選項,如表2-2所示:

    名字

    Class

    描述

    Vertical (default)

    .form-vertical?(not required)

    堆放式, 可控制的左對齊標(biāo)簽

    Inline

    .form-inline

    左對齊標(biāo)簽和簡約的內(nèi)聯(lián)控制塊

    Search

    .form-search

    放大的圓角,具有美感的搜索框

    Horizontal

    .form-horizontal

    左漂浮, 右對齊標(biāo)簽?

    ? ? ? ? ?推薦到官方文檔去體驗下各種表單要素的真實效果,在chrome,Firefox等現(xiàn)代瀏覽器下顯示十分優(yōu)雅。同時可以使用.control-group來控制表單輸入、錯誤等狀態(tài),需要wekit內(nèi)核。如圖2-5所示:

    圖2-5 表單狀態(tài)控制

    ? ? ? ? ? ? ? 代碼片段如下:


    				
    < div? class ="span8" >
    ??????
    < form? class ="form-horizontal" >
    ????????
    < fieldset >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" ?for ="focusedInput" > Focused?input </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? class ="input-xlarge?focused" ?id ="focusedInput" ?type ="text" ?value ="This?is?focused…" >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" > Uneditable?input </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < span? class ="input-xlarge?uneditable-input" > Some?value?here </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" ?for ="disabledInput" > Disabled?input </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? class ="input-xlarge?disabled" ?id ="disabledInput" ?type ="text" ?placeholder ="Disabled?input?here…" ?disabled >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" ?for ="optionsCheckbox2" > Disabled?checkbox </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < label? class ="checkbox" >
    ????????????????
    < input? type ="checkbox" ?id ="optionsCheckbox2" ?value ="option1" ?disabled >
    ????????????????This?is?a?disabled?checkbox
    ??????????????
    </ label >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?warning" >
    ????????????
    < label? class ="control-label" ?for ="inputWarning" > Input?with?warning </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? type ="text" ?id ="inputWarning" >
    ??????????????
    < span? class ="help-inline" > Something?may?have?gone?wrong </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?error" >
    ????????????
    < label? class ="control-label" ?for ="inputError" > Input?with?error </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? type ="text" ?id ="inputError" >
    ??????????????
    < span? class ="help-inline" > Please?correct?the?error </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?success" >
    ????????????
    < label? class ="control-label" ?for ="inputSuccess" > Input?with?success </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? type ="text" ?id ="inputSuccess" >
    ??????????????
    < span? class ="help-inline" > Woohoo! </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?success" >
    ????????????
    < label? class ="control-label" ?for ="selectError" > Select?with?success </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < select? id ="selectError" >
    ????????????????
    < option > 1 </ option >
    ????????????????
    < option > 2 </ option >
    ????????????????
    < option > 3 </ option >
    ????????????????
    < option > 4 </ option >
    ????????????????
    < option > 5 </ option >
    ??????????????
    </ select >
    ??????????????
    < span? class ="help-inline" > Woohoo! </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="form-actions" >
    ????????????
    < button? type ="submit" ?class ="btn?btn-primary" > Save?changes </ button >
    ????????????
    < button? class ="btn" > Cancel </ button >
    ??????????
    </ div >
    ????????
    </ fieldset >
    ??????
    </ form >
    ????
    </ div >

    ? ? 4.按鈕(Buttons).Bootstrap提供多種樣式的按鈕,同樣是通過CSS的類來控制,包括btn, btn-primary,?btn-info,btn-success等不同顏色的按鈕,亦可以簡單通過.btn-large?.btn-mini等CSS的class控制按鈕大小,能夠同時用在<a>,<button>,<input>標(biāo)簽上,非常簡單易用。如圖2-6所示,不同顏色的按鈕:

    圖2-6?按鈕(Buttons)

    ? ? ? ? ? ? ? ?代碼片段如下:

    				
    < div? class ="span8" >
    ??????
    < form? class ="form-horizontal" >
    ????????
    < fieldset >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" ?for ="focusedInput" > Focused?input </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? class ="input-xlarge?focused" ?id ="focusedInput" ?type ="text" ?value ="This?is?focused…" >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" > Uneditable?input </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < span? class ="input-xlarge?uneditable-input" > Some?value?here </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" ?for ="disabledInput" > Disabled?input </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? class ="input-xlarge?disabled" ?id ="disabledInput" ?type ="text" ?placeholder ="Disabled?input?here…" ?disabled >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group" >
    ????????????
    < label? class ="control-label" ?for ="optionsCheckbox2" > Disabled?checkbox </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < label? class ="checkbox" >
    ????????????????
    < input? type ="checkbox" ?id ="optionsCheckbox2" ?value ="option1" ?disabled >
    ????????????????This?is?a?disabled?checkbox
    ??????????????
    </ label >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?warning" >
    ????????????
    < label? class ="control-label" ?for ="inputWarning" > Input?with?warning </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? type ="text" ?id ="inputWarning" >
    ??????????????
    < span? class ="help-inline" > Something?may?have?gone?wrong </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?error" >
    ????????????
    < label? class ="control-label" ?for ="inputError" > Input?with?error </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? type ="text" ?id ="inputError" >
    ??????????????
    < span? class ="help-inline" > Please?correct?the?error </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?success" >
    ????????????
    < label? class ="control-label" ?for ="inputSuccess" > Input?with?success </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < input? type ="text" ?id ="inputSuccess" >
    ??????????????
    < span? class ="help-inline" > Woohoo! </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="control-group?success" >
    ????????????
    < label? class ="control-label" ?for ="selectError" > Select?with?success </ label >
    ????????????
    < div? class ="controls" >
    ??????????????
    < select? id ="selectError" >
    ????????????????
    < option > 1 </ option >
    ????????????????
    < option > 2 </ option >
    ????????????????
    < option > 3 </ option >
    ????????????????
    < option > 4 </ option >
    ????????????????
    < option > 5 </ option >
    ??????????????
    </ select >
    ??????????????
    < span? class ="help-inline" > Woohoo! </ span >
    ????????????
    </ div >
    ??????????
    </ div >
    ??????????
    < div? class ="form-actions" >
    ????????????
    < button? type ="submit" ?class ="btn?btn-primary" > Save?changes </ button >
    ????????????
    < button? class ="btn" > Cancel </ button >
    ??????????
    </ div >
    ????????
    </ fieldset >
    ??????
    </ form >
    ????
    </ div >
    ??
    </ div >

    ?? ? 如果需要更多樣式的按鈕,可以在這個網(wǎng)站來定制。?如果需要更多的整個網(wǎng)站的樣式和風(fēng)格,可以在這個那個網(wǎng)站來定制。

    ? ? ?參考文獻與延伸閱讀

    ? ? ? ? ? ?1.?M. Pilgrim, HTML5: up and running: Oreilly & Associates Inc, 2010

    ? ? ? ? ? ?2.?HTML 5 <caption> 標(biāo)簽?http://www.w3school.com.cn/html5/tag_caption.asp

    ? ? ? ? ? ?3.?StyleBootstrap?http://stylebootstrap.info/

    ? ? ? ? ? ?4. 基于wordpress的Bootstrap ?http://bootstrapwp.rachelbaker.me/

    ? ? ? ? ? ?5.Why did Twitter release Bootstrap??http://www.quora.com/Why-did-Twitter-release-Bootstrap

    posted on 2013-01-31 10:14 禮物 閱讀(5944) 評論(1)  編輯  收藏 所屬分類: BootStrap

    評論

    # re: BootStrap入門教程 (二) 2014-08-13 14:07 zuidaima
    bootstrap demo實例教程源代碼下載:http://zuidaima.com/share/kbootstrap-p1-s1.htm  回復(fù)  更多評論
      


    只有注冊用戶登錄后才能發(fā)表評論。

    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲伊人久久大香线蕉结合| 亚洲AV日韩AV永久无码下载| 亚洲色欲色欲www在线播放| 1000部免费啪啪十八未年禁止观看 | 久久精品免费一区二区喷潮| 亚洲妇女水蜜桃av网网站| 亚洲人成免费电影| 最新亚洲精品国偷自产在线| 在线观看免费为成年视频| 久久精品国产亚洲av品善| 亚洲成人高清在线| 91免费国产视频| 久久亚洲私人国产精品| 永久免费AV无码国产网站| 亚洲AV噜噜一区二区三区 | 久久精品亚洲男人的天堂| 91免费在线视频| 亚洲综合激情六月婷婷在线观看 | 国产精品亚洲产品一区二区三区| av成人免费电影| 亚洲AV日韩AV永久无码久久| 2022久久国产精品免费热麻豆| 国产成人亚洲合集青青草原精品| 香蕉高清免费永久在线视频| 日日狠狠久久偷偷色综合免费| 国产成A人亚洲精V品无码| 3d成人免费动漫在线观看| 亚洲人成网站18禁止| 亚洲精品国产精品国自产观看| 四虎影视无码永久免费| 亚洲精品国产成人| 日本高清色本免费现在观看| 中文字幕无线码中文字幕免费| 亚洲国产精品综合一区在线| 四虎影院永久免费观看| 暖暖日本免费中文字幕| 亚洲AV色无码乱码在线观看| 久久久久亚洲AV成人无码网站| 在线看片人成视频免费无遮挡| 日本一区二区在线免费观看| 亚洲精品偷拍无码不卡av|