<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 評(píng)論 :: 0 Trackbacks

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

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

    1. 排版 (Typography) ,它囊括標(biāo)題(Headings),段落 (paragraphs), 列表(lists)以及其他內(nèi)聯(lián)要素。我們可以通過修改variables.less的兩個(gè)變量:@baseFontSize?和?@baseLineHeight來控制整體排版的樣式。Bootstrap同時(shí)還用了一些其他的算術(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 ?強(qiáng)調(diào)(Emphasis).使用<strong>和<em>兩個(gè)標(biāo)簽,前者使用粗體,后者使用斜體來強(qiáng)調(diào)標(biāo)簽內(nèi)容。請(qǐng)注意<strong>標(biāo)簽在html4中定義語氣更重的強(qiáng)調(diào)文本;在 HTML 5 中,<strong> 定義重要的文本。這些短語標(biāo)簽也可以通過定義CSS的方式來豐富效果。更多短語標(biāo)簽請(qǐng)參見[1].縮寫(abbreviations?).使用<abbr>,它重新封裝了該標(biāo)簽,鼠標(biāo)滑過會(huì)異步地顯示縮寫的含義。引入title屬性來顯示原文,使用.initialism類對(duì)縮寫以大寫方式顯示。

    ? ? ? 1.3 ?引用文字(Blockquotes).使用<blockquote>標(biāo)簽和<small>兩個(gè)標(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),抵御寒冷的烈焰,破曉時(shí)分的光線,喚醒眠者的號(hào)角,守護(hù)王國的堅(jiān)盾。 </ p >
    ??守夜人軍團(tuán)總司令.
    < small > 蒙奇.D. < cite? title ="" > 路飛 </ cite ></ small >
    </ blockquote >
    ??
    </ div >
    ??
    < div? class ="span6?" >
    ??
    < blockquote? >
    ??
    < p > 凌冬將至.
    我是黑暗中的利劍,長城上的守衛(wèi),抵御寒冷的烈焰,破曉時(shí)分的光線,喚醒眠者的號(hào)角,守護(hù)王國的堅(jiān)盾。
    </ p >
    ??守夜人軍團(tuán)總司令.
    < 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)表格。主要提供了四個(gè)css的類來控制表格的邊和結(jié)構(gòu)。表2-1顯示了bootstrap的table可選項(xiàng)。

    ?

    名字

    Class

    描述

    Default

    None

    沒有樣式,只有行和列

    Basic

    .table

    只有在行間有豎線

    Bordered

    .table-bordered

    圓角和添加外邊框

    Zebra-stripe

    .table-striped

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

    Condensed

    .table-condensed

    將橫向的 padding 對(duì)切

    ?

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

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

    圖2-4 表格(Table)


    ?

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

    名字

    Class

    描述

    Vertical (default)

    .form-vertical?(not required)

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

    Inline

    .form-inline

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

    Search

    .form-search

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

    Horizontal

    .form-horizontal

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

    ? ? ? ? ?推薦到官方文檔去體驗(yàn)下各種表單要素的真實(shí)效果,在chrome,Firefox等現(xiàn)代瀏覽器下顯示十分優(yōu)雅。同時(shí)可以使用.control-group來控制表單輸入、錯(cuò)誤等狀態(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等不同顏色的按鈕,亦可以簡(jiǎn)單通過.btn-large?.btn-mini等CSS的class控制按鈕大小,能夠同時(shí)用在<a>,<button>,<input>標(biāo)簽上,非常簡(jiǎn)單易用。如圖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 >

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

    ? ? ?參考文獻(xiàn)與延伸閱讀

    ? ? ? ? ? ?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 禮物 閱讀(5945) 評(píng)論(1)  編輯  收藏 所屬分類: BootStrap

    評(píng)論

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


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

    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲色偷偷av男人的天堂| 亚洲免费中文字幕| 中文字幕在线观看免费视频 | 暖暖免费高清日本一区二区三区| 日本系列1页亚洲系列| 亚洲AV无码一区二区二三区入口 | 免费看片免费播放| 男女一进一出抽搐免费视频| 亚洲人成免费网站| 国产亚洲美女精品久久久2020| 国产精品1024永久免费视频| 无码毛片一区二区三区视频免费播放 | 免费大片av手机看片高清| 亚洲AV色香蕉一区二区| 在线视频免费国产成人 | 亚洲精品无码永久中文字幕| 大地资源二在线观看免费高清| 中文无码日韩欧免费视频| 欧洲 亚洲 国产图片综合| 亚洲av永久中文无码精品综合| 国产亚洲精品线观看动态图| 久久不见久久见免费影院| 精品国产污污免费网站| 国产亚洲综合视频| 亚洲中文字幕久久精品无码2021| 亚洲日韩精品A∨片无码| 手机看片久久国产免费| 无码av免费毛片一区二区| 花蝴蝶免费视频在线观看高清版| 亚洲成熟丰满熟妇高潮XXXXX| 久久亚洲熟女cc98cm| 亚洲码国产精品高潮在线| 国产精品美女自在线观看免费| 亚洲免费视频观看| 久久综合九色综合97免费下载| 美女视频黄.免费网址| 亚洲色成人网站WWW永久四虎| 亚洲三级电影网址| 亚洲AV无码久久精品成人| 久久影视综合亚洲| 亚洲高清免费视频|