Wɔ scaffolding no atifi no, wɔayɛ HTML nneɛma atitiriw no su na wɔde adesua ahorow a wotumi trɛw mu ayɛ no yiye de ama woanya hwɛ ne atenka foforo a ɛkɔ so daa.
Typographic grid no nyinaa gyina Less variables abien so wɔ yɛn variables.less fael no mu: @baseFontSize
ne @baseLineHeight
. Nea edi kan ne base font-size a wɔde di dwuma wɔ ne nyinaa mu na nea ɛto so abien ne base line-height.
Yɛde saa variables no, ne akontabuo bi, yɛ margins, paddings, ne line-heights a ɛwɔ yɛn type no nyinaa ne nea ɛkeka ho.
Nullam quis risus eget urna mollis a ɛyɛ fɛ a ɛyɛ fɛ a ɛyɛ fɛ. Cum sociis natoque penatibus ne magnis awo montes, nascetur fɛwdi mus. Nullam id dolor id nibh ultricies kar a wɔde di dwuma.
Ma nkyekyem bi da nsow denam .lead
.
Vivamus sagittis lacus vel augue laoreet a ɛyɛ mmerɛw sɛ wobɛtɔ no. Duis mollis, est a ɛnyɛ ade a wɔde yɛ nneɛma.
Adeɛ | Sɛnea wɔde di dwuma | Ɛnyɛ ɔhyɛ |
---|---|---|
<strong> |
Sɛ́ wusi nsɛm a wɔakyerɛw no fã bi so dua a ɛho hia | Ɛnyɛ ebiara |
<em> |
Sɛ́ wode adwennwen si nsɛm a wɔakyerɛw no fã bi so dua no | Ɛnyɛ ebiara |
<abbr> |
Ɔkyekyere nsɛmfua ntiantiaa ne nsɛmfua a wɔatwa no tiaa de kyerɛ nkyerɛase a wɔatrɛw mu no wɔ hover so | Fa su a wopɛ .initialism class di dwuma ma nkyerɛwde akɛse a wɔatwa no tiaa. |
<address> |
Sɛ wopɛ ne nana a ɔbɛn no paa anaa adwuma no nyinaa ho nsɛm a | Kora formatting so denam nkyerɛwde nyinaa a wode bɛba awiei no so<br> |
Fusce dapibus , tellus ac cursus commodo , tortor mauris aduru a wɔde yɛ aduan nibh , ut aduru a wɔde yɛ aduru a wɔde yɛ aduru a wɔde yɛ aduan a ɛyɛ mmerɛw sɛ wobɛtra ase amet risus. Maecenas faucibus mollis a ɛwɔ ntam no. Nulla vitae elit libero, a ɛyɛ aduru a wɔde di dwuma wɔ ɔkwan a ɛfata so.
Hyɛ no nsow: Fa ahofadi de di dwuma <b>
ne <i>
HTML5 mu, nanso wɔn dwumadie asesa kakra. <b>
no kyerɛ sɛ ɛbɛtwe adwene asi nsɛmfua anaa nsɛmfua so a ɛrenkyerɛ hia foforo a ɛho hia bere a <i>
ɛyɛ nea ɛfa nne, mfiridwuma mu nsɛmfua, ne nea ɛkeka ho ho titiriw.
Nhwɛso abien a ɛkyerɛ sɛnea <address>
wobetumi de tag no adi dwuma ni:
Nsɛmfua a wɔatwa no tiaa a ɛwɔ title
su bi wɔ ase hye a ɛwɔ nsensanee a ɛyɛ hann ne mmoa cursor a ɛwɔ hover so. Eyi ma users extra indication biribi a wɔbɛkyerɛ wɔ hover so.
Fa initialism
adesuakuw no ka asɛmfua tiawa bi ho na ama nkyerɛwee a ɛne ne ho hyia no ayɛ kɛse denam nsɛm a wobɛma ayɛ ketewaa kakra no so.
HTML yɛ ade a eye sen biara fi bere a wɔatwitwa paanoo no.
Asɛmfua su no a wɔatwa no tiaa ne attr .
Adeɛ | Sɛnea wɔde di dwuma | Ɛnyɛ ɔhyɛ |
---|---|---|
<blockquote> |
Block-level element a wɔde fa nsɛm a efi fibea foforo mu ka | Fa .pull-left ne .pull-right adesua ahorow ma floated options |
<small> |
Optional element a wode bɛka asɛm bi a ɛfa nea ɔde di dwuma ho, mpɛn pii no ɔkyerɛwfo a ɔwɔ adwuma no asɛmti | Fa nea <cite> ɛwɔ asɛmti anaa din a efi fibea no ho hyia |
Sɛ wode blockquote bɛka ho a, fa HTML<blockquote>
biara kyekyere ho sɛ quote no. Sɛ wopɛ nsɛm a wɔafa aka tẽẽ a yɛkamfo kyerɛ sɛ .<p>
Fa <small>
element a wopɛ ka ho a wode bɛkyerɛ wo fibea na wubenya em dash —
ansa na ɛreba ama styling atirimpɔw ahorow.
- <asɛm a wɔde siw ano>
- | _ Integer posuere erat a ɛyɛ anim a ɛyɛ mmerɛw. </p> no
- <small> Obi a wagye din </small>
- </blockquote> a wɔde kyerɛw nsɛm
Wɔayɛ blockquotes a wɔahyɛ da ayɛ no sɛnea ɛte no:
Lorem ipsum dolor tena amet, consectetur adipiscing a ɛyɛ fɛ a ɛyɛ fɛ. Integer posuere erat a ɛyɛ anim aduru.
Obi a wagye din wɔ Body of work mu
Sɛ wopɛ sɛ wo blockquote no kɔ nifa so a, fa ka ho class="pull-right"
:
Lorem ipsum dolor tena amet, consectetur adipiscing a ɛyɛ fɛ a ɛyɛ fɛ. Integer posuere erat a ɛyɛ anim aduru.
Obi a wagye din wɔ Body of work mu
<ul>
<ul class="unstyled">
<ol>
<dl>
<dl class="dl-horizontal">
Ti a ɛwɔ soro! Horizontal description lists bɛtwa nsɛmfua a ɛware dodo sɛ ɛbɛhyɛ benkum column fix text-overflow
no mu . Wɔ viewports teateaa mu no, wɔbɛsesa akɔ default stacked layout no so.
Fa inline snippets a ɛwɔ code no mu no kyekyere <code>
.
- Sɛ nhwɛso no , ɛsɛ sɛ wɔkyekyere <code> ɔfã </ code > no sɛ inline .
Fa di dwuma <pre>
ma koodu nkyerɛwde ahorow pii. Hwɛ hu sɛ wubeguan afi angle brackets biara a ɛwɔ code no mu no mu na ama woatumi akyerɛ ase yiye.
<p>Nsɛm a wɔakyerɛw no nhwɛso wɔ ha...</p>
- <pre> no
- <p>Nsɛm a wɔakyerɛw no nhwɛso wɔ ha...</p>
- </pre> no
Hyɛ no nsow: Hwɛ hu sɛ wode code bɛto <pre>
tag ahorow no mu a ɛbɛn benkum sɛnea wubetumi; ɛbɛkyerɛ tab ahorow no nyinaa ase.
Wubetumi apaw de .pre-scrollable
adesuakuw a ɛbɛhyehyɛ max-height a ɛyɛ 350px na ama y-axis scrollbar no aka ho.
Fa <pre>
element koro no ara na fa adesua ahorow abien a wopɛ ka ho ma nkyerɛase a ɛkɔ anim.
- <p> Nsɛm a wɔakyerɛw ho nhwɛso wɔ ha... </p>
- <pre class = "asɛm a ɛyɛ fɛ."
- nkyerɛwde ahorow" >
- <p>Nsɛm a wɔakyerɛw no nhwɛso wɔ ha...</p>
- </pre> no
Twe google-code-prettify na hwɛ readme no na woahu sɛnea wode bedi dwuma.
Ahyɛnsoɔ | Nkyerɛmu |
---|---|
<table> |
Wrapping element a wɔde kyerɛ data wɔ tabular format mu |
<thead> |
Container element ma table header rows ( <tr> ) de hyɛ table columns agyirae |
<tbody> |
Container element ma table rows ( <tr> ) wɔ table no nipadua mu |
<tr> |
Container element ma table cells ( <td> anaa <th> ) a epue wɔ row biako so |
<td> |
Default table cell a wɔde ahyɛ mu |
<th> |
Table cell soronko ma column (anaasɛ row, a egyina scope ne placement so) labels Ɛsɛ sɛ wɔde di dwuma wɔ a <thead> |
<caption> |
Nea pon no kura ho nkyerɛkyerɛmu anaa nsɛm a wɔaboaboa ano, titiriw a ɛho wɔ mfaso ma screen akenkanfo |
- <pon>
- <ti>
- <tr>
- <th> ... </th> na ɛwɔ hɔ
- <th> ... </th> na ɛwɔ hɔ
- </tr>a ɛwɔ hɔ
- </thead> no ho
- <nipadua>
- <tr>
- <td> ... </td> na ɛwɔ hɔ
- <td> ... </td> na ɛwɔ hɔ
- </tr>a ɛwɔ hɔ
- </tbody> no ho
- </table> no
Din | Klaase | Nkyerɛmu |
---|---|---|
Mfiaseɛ | Ɛnyɛ ebiara | Styles biara nni hɔ, columns ne rows kɛkɛ |
Mfiasesɛm | .table |
Ntrɛwmu a ɛda ntoatoaso ntam nkutoo |
Wɔde hye so | .table-bordered |
Rounds corners na ɛde akyi hye ka ho |
Ɔsebɔ-a ɛyɛ nsensanee | .table-striped |
Ɛde akyi kɔla a ɛyɛ hann a ɛyɛ fitaa ka row ahorow a ɛyɛ nwonwa (1, 3, 5, ne nea ɛkeka ho) ho . |
Wɔayɛ no tiawa | .table-condensed |
Twitwa vertical padding mu fã, fi 8px kosi 4px, wɔ ne nyinaa td ne th elements mu |
Wɔayɛ pon ahorow no ho nhyehyɛe ankasa a ɛwɔ ahye kakraa bi pɛ na ama wɔatumi akenkan na wɔakura nhyehyɛe mu. Sɛ wowɔ 2.0 a, .table
adesuakuw no yɛ nea wɔhwehwɛ.
- <pon adesua = "pon" >
- ...
- </table> no
# . | Fie din | Abusuadin | Edin a wɔde di dwuma |
---|---|---|---|
1. 1. | Marko | Otto na ɔkyerɛwee | @mdo na ɔkyerɛwee |
2. 2. | Yakob | Thornton na ɔkyerɛwee | @kɛseɛ |
3. 3 | Larry na ɔkyerɛwee | Anomaa no | @twitter so |
Nya wo pon ahorow no ho fɛfɛɛfɛ kakra denam zebra-striping a wode bɛka ho no so —fa .table-striped
adesuakuw no ka ho ara kwa.
Hyɛ no nsow: Striped tables de :nth-child
CSS selector no di dwuma na enni IE7-IE8 mu.
- <pon adesua = "pon pon-striped" >
- ...
- </table> no
# . | Fie din | Abusuadin | Edin a wɔde di dwuma |
---|---|---|---|
1. 1. | Marko | Otto na ɔkyerɛwee | @mdo na ɔkyerɛwee |
2. 2. | Yakob | Thornton na ɔkyerɛwee | @kɛseɛ |
3. 3 | Larry na ɔkyerɛwee | Anomaa no | @twitter so |
Fa ahye atwa pon no nyinaa ho ahyia ne ntwea a ɛyɛ kurukuruwa ka ho ma ɛyɛ fɛ.
- <table class = "pon a ɛwɔ pon so" >
- ...
- </table> no
# . | Fie din | Abusuadin | Edin a wɔde di dwuma |
---|---|---|---|
1. 1. | Marko | Otto na ɔkyerɛwee | @mdo na ɔkyerɛwee |
Marko | Otto na ɔkyerɛwee | @getbootstrap na ɛyɛ | |
2. 2. | Yakob | Thornton na ɔkyerɛwee | @kɛseɛ |
3. 3 | Larry Anomaa no | @twitter so |
Ma wo tables no nyɛ ketewaa denam .table-condensed
adesua no a wode bɛka ho de atwitwa table cell padding no mu fã (efi 8px kosi 4px).
- <table class = "pon pon-a wɔatwa no tiaa" >
- ...
- </table> no
# . | Fie din | Abusuadin | Edin a wɔde di dwuma |
---|---|---|---|
1. 1. | Marko | Otto na ɔkyerɛwee | @mdo na ɔkyerɛwee |
2. 2. | Yakob | Thornton na ɔkyerɛwee | @kɛseɛ |
3. 3 | Larry Anomaa no | @twitter so |
Fa ahofadi bɛka table adesua ahorow no mu biara abom na ama woanya hwɛbea ahorow denam adesua ahorow a ɛwɔ hɔ no mu biara a wode bedi dwuma no so.
- <table class = "pon pon-striped pon-hye so pon-a wɔabɔ no mua" >
- ...
- </table> no
Edin mũ no nyinaa | |||
---|---|---|---|
# . | Fie din | Abusuadin | Edin a wɔde di dwuma |
1. 1. | Marko | Otto na ɔkyerɛwee | @mdo na ɔkyerɛwee |
2. 2. | Yakob | Thornton na ɔkyerɛwee | @kɛseɛ |
3. 3 | Larry Anomaa no | @twitter so |
Ɔfã a eye sen biara wɔ nkrataa a ɛwɔ Bootstrap mu ne sɛ wo inputs ne controls nyinaa hwɛ yiye ɛmfa ho sɛnea wobɛkyekye wɔ wo markup no mu. HTML a ɛho nhia biara nhia, nanso yɛde nhwɛso ahorow no ma wɔn a wɔhwehwɛ no.
Nhyehyɛe a ɛyɛ den kɛse no de adesua ahorow a ɛyɛ tiawa na wotumi sesa no ba ma ɛyɛ mmerɛw sɛ wobɛhyehyɛ ne adeyɛ a ɛkyekyere, enti wɔakata wo so wɔ anammɔn biara mu.
Bootstrap de mmoa ma fom nhyehyɛe ahorow anan ba:
Fom nhyehyeɛ ahodoɔ hwehwɛ sɛ wɔyɛ nsakraeɛ bi wɔ agyiraeɛhyɛdeɛ mu, nanso controls no ankasa kɔ so tra hɔ na ɛyɛ wɔn ade saa ara.
Bootstrap no nkrataa no ka styles ma base form controls nyinaa te sɛ input, textarea, ne select a wobɛhwɛ kwan. Nanso ɛsan nso de custom components dodow bi te sɛ appended ne prepended inputs ne mmoa ma lists of checkboxes ba.
Nsɛm te sɛ mfomso, kɔkɔbɔ, ne nkonimdi ka ho ma kratasin sohwɛ ahorow biara. Nea ɛka ho nso ne styles a wɔde yɛ controls a wɔadi dɛm.
Bootstrap ma markup a ɛnyɛ den ne styles ma styles anan a ɛwɔ wɛb nkrataa a wɔtaa de di dwuma.
Din | Klaase | Nkyerɛmu |
---|---|---|
Ɛgyina hɔ (default) . | .form-vertical (ɛnyɛ nea wɔhwehwɛ) . |
Nkyerɛwde ahorow a wɔaboaboa ano, a wɔahyehyɛ no benkum so wɔ nneɛma a wɔde di dwuma so |
Inline no mu | .form-inline |
Benkum-aligned label ne inline-block controls ma compact style |
Hwehwɛ | .form-search |
Extra-rounded text input ma typical nhwehwɛmu aesthetic |
Ne tɛtrɛtɛ mu | .form-horizontal |
Float benkum, nifa-ahyɛnsode labels wɔ line koro no ara so sɛ controls |
Smart ne lightweight defaults a enni markup foforo.
- <form class = "wiɛ" >
- <label> Label din </label>
- <input type = "text" class = "span3" beaeɛ = "Twerɛ biribi..." >
- <span class = "help-block" > Nhwɛsoɔ block-level mmoa nkyerɛwee wɔ ha. </span> no
- <label adesuakuw = "nhyɛnsode adaka" >
- <input type = "checkbox" > Hwɛ me
- </label> a wɔde kyerɛw nsɛm
- <button type = "fa kɔ" class = "btn" > Fa kɔ </button>
- </form>
Fa ka .form-search
kratasin no ho .search-query
ne input
.
- <form class = "wia fom-hwehwɛ" >
- <input type = "text" class = "input-medium hwehwɛ-asɛmmisa" >
- <button type = "submit" class = "btn" > Hwehwɛ </bɔtn>
- </form>
Fa ka ho .form-inline
ma finesse vertical alignment ne spacing a ɛwɔ form controls no mu.
- <form class = "wia fom-inline" >
- <nhyɛaseɛ su = "nkyerɛwee" adesuakuw = "nhyɛaseɛ-ketewa" beaeɛ = "Email" >
- <input type = "password" class = "input-ketewa" beae = "Asɛmfua" >
- <label adesuakuw = "nhyɛnsode adaka" >
- <input type = "checkbox" > Kae me
- </label> a wɔde kyerɛw nsɛm
- <button type = "submit" class = "btn" > Fa wo ho hyɛ mu </button>
- </form>
Wɔakyerɛ wɔ nifa so ne default form controls a yɛboa no nyinaa. Nsɛm a wɔahyehyɛ a wɔabɔ no atuo no ni:
Sɛ yɛde atifi hɔ nhwɛso krataa nhyehyɛe no ama a, ɛha na markup a ɛbata input ne control kuw a edi kan no ho. , .control-group
, .control-label
ne .controls
adesua ahorow no nyinaa yɛ nea wɔhwehwɛ ma styling.
- <fom adesuakuw = "fom-horizontal" >
- <afuw mu nhyehyɛe>
- <anansesɛm> Atetesɛm mu nsɛm </anansesɛm>
- <div class = "ahyɛnsodeɛ-kuo" >
- <label class = "control-label" ma = "nhyɛase01" > Nsɛm a wɔde hyɛ mu </label>
- <div adesuakuw = "ahyɛnsode" >
- <nhyɛaseɛ type = "nkyerɛwee" adesuakuw = "nhyɛase-xlarge" id = "nhyɛase01" >
- <p class = "help-block" > Mmoa nkyerɛwee a ɛboa </p>
- </div> no
- </div> no
- </afuw mu nhyehyɛe>
- </form>
Bootstrap kyerɛ styles ma browser-boa focused ne disabled
states. Yɛyi Webkit a wɔahyɛ da ayɛ no outline
na yɛde a box-shadow
si n’ananmu ma :focus
.
Ɛsan nso de validation styles ma mfomso, kɔkɔbɔ, ne nkonimdi ka ho. Sɛ wode bedi dwuma a, fa mfomso adesuakuw no ka nea atwa ho ahyia no ho .control-group
.
- <afuw mu nhyehyɛe
- class = "ahyɛnsodeɛ-kuo mfomsoɔ" >
- ...
- </afuw mu nhyehyɛe>
Nsɛm a wɔde hyɛ mu akuw ahorow—a wɔde nsɛm a wɔde aka ho anaa wɔde ahyɛ mu ma—ma ɔkwan a ɛyɛ mmerɛw a wobɛfa so ama nsɛm a ɛfa ho pii ama wo nsɛm a wode bɛhyɛ mu no. Nhwɛsoɔ akɛseɛ bi ne @ sɛnkyerɛnne a ɛkyerɛ Twitter dwumadie din anaa $ ma sikasɛm.
Ɛde besi v1.4 no, na Bootstrap hia markup foforo atwa checkboxes ne radio ahorow ho ahyia na ama wɔatumi ayɛ stack. Afei, ɛyɛ asɛm a ɛyɛ mmerɛw sɛ wobɛsan ayɛ nea <label class="checkbox">
ɛkata <input type="checkbox">
.
Wɔboa inline checkboxes ne radio ahorow nso. Fa bi ka anaa .inline
biara ho kɛkɛ na woawie..checkbox
.radio
Sɛ wode prepend anaa append inputs bedi dwuma wɔ inline form mu a, hwɛ hu sɛ wode .add-on
ne input
no bɛto line koro no ara so, a space biara nni mu.
Sɛ wode mmoa nsɛm bɛka wo fom nsɛm a wode bɛhyɛ mu no ho a, fa inline mmoa nsɛm a ɛwɔ mu <span class="help-inline">
anaa mmoa nsɛm a wɔde siw ano <p class="help-block">
wɔ nsɛm a wɔde hyɛ mu no akyi ka ho.
Sɛ́ anka yɛbɛma ahyɛnsode biara ayɛ abisade foforo no, yɛaboaboa ano ayɛ no sprite —mfonini ahorow a ɛwɔ fael biako mu a ɛde CSS di dwuma de mfonini ahorow no si hɔ denam background-position
. Eyi ne ɔkwan koro no ara a yɛde di dwuma wɔ Twitter.com na ayɛ adwuma yiye ama yɛn.
Wɔde ahyɛnsodeɛ adesua ahodoɔ no nyinaa di anim .icon-
ma edin ntam kwan ne scoping a ɛfata, te sɛ yɛn afã foforɔ no ara pɛ. Eyi bɛboa ma woakwati ntawntawdi ne nnwinnade afoforo.
Glyphicons ama yɛn kwan sɛ yɛde Halflings a wɔahyehyɛ no nni dwuma wɔ yɛn open-source toolkit no mu bere tenten a yɛde link ne credit bɛma wɔ ha wɔ docs no mu no. Yɛsrɛ sɛ susuw ho sɛ wobɛyɛ saa ara wɔ wo nnwuma ahorow mu.
Bootstrap de <i>
tag di dwuma ma ahyɛnsode ahorow nyinaa, nanso wonni case class biara —prefix a wɔakyekyɛ nkutoo. Sɛ wode bedi dwuma a, ɛkame ayɛ sɛ fa koodu a edidi so yi to baabiara:
- <i adesuakuw = "ahyɛnsode-hwehwɛ" ></i>
Afei nso, nneɛma ahorow bi wɔ hɔ a wɔde yɛ ahyɛnsode ahorow a wɔadan no (fitaa), a wɔayɛ no krado a wɔde adesuakuw biako aka ho:
- <i class = "ahyɛnsode-hwehwɛ ahyɛnsode-fitaa" ></i>
Adesuakuw ahorow 140 na ɛwɔ hɔ a wubetumi apaw bi ama wo mfonini ahorow no. Fa <i>
tag bi ka ho kɛkɛ a ɛwɔ classes a ɛfata na woayɛ set. Wubetumi ahu list no nyinaa wɔ sprites.less anaa ha yi ara wɔ saa krataa yi mu.
Ti a ɛwɔ soro! Sɛ wode nsɛm a ɛwɔ nhama ho redi dwuma, te sɛ nea ɛwɔ bɔtn anaa nav link ahorow mu no a, hwɛ hu sɛ wubegyaw baabi wɔ <i>
tag no akyi ama ntam kwan a ɛfata.
Ahyɛnsode ahorow yɛ kɛse, nanso ɛhe na obi de bedi dwuma? Nsusuwii kakraa bi ni:
Ne titiriw no, baabiara a wubetumi de <i>
tag ahyɛ mu no, wubetumi de ahyɛnsode bi ahyɛ mu.
Fa di dwuma wɔ bɔtn, bɔtn akuw ma adwinnade pon, akwantu, anaa kratasin a wɔde ahyɛ mu a wɔadi kan ahyɛ mu.