Awọn eroja HTML pataki ti ṣe aṣa ati imudara pẹlu awọn kilasi extensible.
Gbogbo awọn akọle HTML, <h1>
nipasẹ <h6>
wa.
Aiyipada agbaye ti Bootstrap font-size
jẹ 14px , pẹlu kan line-height
ti 20px . Eyi ni a lo si <body>
ati gbogbo awọn paragira. Ni afikun, <p>
(awọn paragira) gba ala isalẹ ti idaji ila-giga wọn (10px nipasẹ aiyipada).
Nullam quis risus eget urna mollis ornare vel eu leo. Bi o ṣe le jẹ penatibus ati magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Bi o ṣe le jẹ penatibus ati magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla ti kii metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla ti kii metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet ti kii magna. Donec id elit ti kii mi porta gravida ati eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
<p> ... </p>
Ṣe paragira kan duro jade nipa fifi kun .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est ti kii commodo luctus.
<p kilasi = "asiwaju" > ... </p>
Iwọn ikọwe da lori awọn oniyipada KERE meji ni awọn oniyipada.less : @baseFontSize
ati @baseLineHeight
. Ni igba akọkọ ti ni awọn mimọ-iwọn font lo jakejado ati awọn keji ni awọn mimọ ila-giga. A lo awọn oniyipada wọnyẹn ati awọn iṣiro ti o rọrun lati ṣẹda awọn ala, awọn paddings, ati awọn giga laini ti gbogbo iru wa ati diẹ sii. Ṣe akanṣe wọn ati awọn aṣamubadọgba Bootstrap.
Ṣe lilo awọn afi tcnu aiyipada HTML pẹlu awọn aza iwuwo fẹẹrẹ.
<small>
Fun tẹnumọ opopo tabi awọn bulọọki ọrọ, lo aami kekere naa.
Laini ọrọ yii jẹ itumọ lati ṣe itọju bi titẹjade itanran.
<p> <kekere> Laini ọrọ yii jẹ itumọ lati ṣe itọju bi titẹ daradara. </small> </p>
Fun tẹnumọ snippet ti ọrọ kan pẹlu iwuwo fonti ti o wuwo.
Apejuwe ọrọ ti o tẹle yii jẹ itumọ bi ọrọ igboya .
<strong> ti a ṣe bi ọrọ igboya </strong>
Fun tẹnumọ snippet ti ọrọ pẹlu awọn italics.
Abọ ọrọ ti o tẹle yii jẹ jijẹ bi ọrọ italicized .
<em> ṣe itumọ bi ọrọ italicized </em>
Efeti sile!Lero ọfẹ lati lo <b>
ati <i>
ni HTML5. <b>
Itumọ lati ṣe afihan awọn ọrọ tabi awọn gbolohun ọrọ laisi sisọ pataki pataki lakoko <i>
ti o jẹ pupọ julọ fun ohun, awọn ofin imọ-ẹrọ, ati bẹbẹ lọ.
Ni irọrun ṣe atunṣe ọrọ si awọn paati pẹlu awọn kilasi titete ọrọ.
Ọrọ ti o ni ibamu si apa osi.
Ọrọ ti o ni ibamu si aarin.
Ọrọ ti o ni ibamu si ọtun.
- <p class = "text-left" > Ọrọ ti o sosi osi. </p>
- <p class = "text-center" > Ọrọ ti o ni ibamu si aarin. </p>
- <p class = "text-right" > Ọrọ ti o somọ ọtun. </p>
Ṣe afihan itumọ nipasẹ awọ pẹlu iwonba ti awọn kilasi IwUlO tcnu.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla ti kii metus auctor fringilla.
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
- <p kilasi = "dapibus" Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh. </p>
- <p class = "text-ikilo" > Etiam porta sem malesuada magna mollis euismod. </p>
- <p class = "text-error" > Donec ullamcorper nulla ti kii metus auctor fringilla. </p>
- <p class = "text-info" > Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis. </p>
- <p class = "text-success" > Duis mollis, est non commodo luctus, nisi erat porttitor ligula. </p>
Imuse aṣa ti ẹya HTML <abbr>
fun awọn kuru ati awọn adape lati ṣafihan ẹya ti o gbooro lori rababa. Awọn kuru pẹlu abuda kan title
ni aala ti o ni aami ina ti isalẹ ati kọsọ iranlọwọ lori rababa, pese aaye afikun lori rababa.
<abbr>
Fun ọrọ ti o gbooro lori rababa gigun ti abbreviation kan, pẹlu title
abuda naa.
An abbreviation ti ọrọ ikalara ni attr .
<abbr akọle = "iwa" > attr </abbr>
<abbr class="initialism">
Ṣafikun .initialism
si abbreviation fun iwọn fonti kekere diẹ.
HTML jẹ ohun ti o dara julọ niwon akara ti a ge wẹwẹ.
<abbr akọle = "HyperText Siṣamisi Language" kilasi = "ibẹrẹ" > HTML </abbr>
Pese alaye olubasọrọ fun baba ti o sunmọ tabi gbogbo ara iṣẹ.
<address>
Ṣetọju ọna kika nipa ipari gbogbo awọn ila pẹlu <br>
.
- <adirẹsi>
- <strong> Twitter, Inc. </strong><br>
- 795 Folsom Ave, Suite 600 <br>
- San Francisco, CA 94107 <br>
- <abbr akọle = "Foonu" > P: </abbr> (123) 456-7890
- </adiresi>
- <adirẹsi>
- <strong> Ekunrere Oruko </strong><br>
- <a href = "mailto:#" > [email protected] </a>
- </adiresi>
Fun sisọ awọn bulọọki akoonu lati orisun miiran laarin iwe rẹ.
Fi ipari si <blockquote>
eyikeyi HTML bi agbasọ. Fun awọn agbasọ taara a ṣeduro <p>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Odidi posuere erat a ante.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Odidi posuere erat a ante. </p>
- </blockquote>
Aṣa ati akoonu yipada fun awọn iyatọ ti o rọrun lori blockquote boṣewa.
Ṣafikun <small>
tag fun idamo orisun naa. Fi orukọ iṣẹ orisun sinu <cite>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Odidi posuere erat a ante.
Ẹnikan olokiki ni Akọle Orisun
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Odidi posuere erat a ante. </p>
- <small> Ẹnikan olokiki <cite title = "Akọle Orisun" > Akọle Orisun </cite></small>
- </blockquote>
Lo .pull-right
fun leefofo loju omi, blockquote titọ-ọtun.
- <blockquote class = "pull-right" >
- ...
- </blockquote>
Atokọ awọn ohun kan ninu eyiti aṣẹ ko ṣe pataki.
- <ul>
- <li> ... </li>
- </ul>
Atokọ awọn ohun kan ninu eyiti aṣẹ naa ṣe pataki.
- <ol>
- <li> ... </li>
- </ol>
Yọ aiyipada list-style
kuro ati fifẹ osi lori awọn ohun akojọ (awọn ọmọde lẹsẹkẹsẹ nikan).
- <ul kilasi = "aiṣedeede" >
- <li> ... </li>
- </ul>
Fi gbogbo awọn ohun akojọ sori laini kan pẹlu inline-block
ati diẹ ninu padding ina.
- <ul kilasi = "inline" >
- <li> ... </li>
- </ul>
Atokọ awọn ofin pẹlu awọn apejuwe ti o somọ wọn.
- <dl>
- <dt> ... </dt>
- <dd> ... </dd>
- </dl>
Ṣe awọn ofin ati awọn apejuwe ni <dl>
ila ni ẹgbẹ-ẹgbẹ.
- <dl kilasi = "dl-petele" >
- <dt> ... </dt>
- <dd> ... </dd>
- </dl>
Efeti sile!Awọn atokọ apejuwe petele yoo ge awọn ọrọ ti o gun ju lati baamu ni atunṣe ọwọn osi text-overflow
. Ni awọn ibudo wiwo ti o dín, wọn yoo yipada si ipilẹ tolera aiyipada.
Pa awọn snippets inline ti koodu pẹlu <code>
.
<section>
yẹ ki o wa ni ti a we bi inline.
- Fun apẹẹrẹ , <koodu> & lt ; apakan & gt ;</ code > yẹ ki o wa ni we bi inline .
Lo <pre>
fun ọpọ ila ti koodu. Rii daju pe o sa fun eyikeyi awọn biraketi igun ninu koodu fun ṣiṣe deede.
<p>Apeere ọrọ nibi...</p>
- <tẹlẹ>
- <p> Ayẹwo ọrọ nibi...</p>
- </pre>
Efeti sile!Rii daju pe o tọju koodu laarin <pre>
awọn afi bi isunmọ si osi bi o ti ṣee; yoo mu gbogbo awọn taabu.
O le ṣe afikun .pre-scrollable
kilaasi ni yiyan eyi ti yoo ṣeto giga-giga ti 350px ati pese ọpa lilọ-y-axis kan.
Fun iselona ipilẹ — fifẹ ina ati awọn ipin petele nikan — ṣafikun kilasi ipilẹ .table
si eyikeyi <table>
.
# | Orukọ akọkọ | Oruko idile | Orukọ olumulo |
---|---|---|---|
1 | Samisi | Otto | @mdo |
2 | Jakobu | Thornton | @sanra |
3 | Larry | Eye |
- <tabili kilasi = "tabili" >
- …
- </tabili>
Ṣafikun eyikeyi awọn kilasi atẹle si kilasi .table
mimọ.
.table-striped
Ṣe afikun abila-fikun si ori tabili eyikeyi laarin <tbody>
nipasẹ :nth-child
yiyan CSS (ko si ni IE7-8).
# | Orukọ akọkọ | Oruko idile | Orukọ olumulo |
---|---|---|---|
1 | Samisi | Otto | @mdo |
2 | Jakobu | Thornton | @sanra |
3 | Larry | Eye |
- <tabili kilasi = "tabili-ṣiṣibo tabili" >
- …
- </tabili>
.table-bordered
Fi awọn aala ati awọn igun yika si tabili.
# | Orukọ akọkọ | Oruko idile | Orukọ olumulo |
---|---|---|---|
1 | Samisi | Otto | @mdo |
Samisi | Otto | @getbootstrap | |
2 | Jakobu | Thornton | @sanra |
3 | Larry Eye |
- <tabili kilasi = "tabili-aala" >
- …
- </tabili>
.table-hover
Mu ipo fifin ṣiṣẹ lori awọn ori ila tabili laarin <tbody>
.
# | Orukọ akọkọ | Oruko idile | Orukọ olumulo |
---|---|---|---|
1 | Samisi | Otto | @mdo |
2 | Jakobu | Thornton | @sanra |
3 | Larry Eye |
- <tabili kilasi = "tabili-hover" >
- …
- </tabili>
.table-condensed
Mu ki awọn tabili jẹ iwapọ diẹ sii nipa gige padding sẹẹli ni idaji.
# | Orukọ akọkọ | Oruko idile | Orukọ olumulo |
---|---|---|---|
1 | Samisi | Otto | @mdo |
2 | Jakobu | Thornton | @sanra |
3 | Larry Eye |
- <tabili kilasi = "tabili-condensed" >
- …
- </tabili>
Lo awọn kilasi ọrọ-ọrọ lati ṣe awọ awọn ori ila tabili.
Kilasi | Apejuwe |
---|---|
.success |
Ṣe afihan iṣe aṣeyọri tabi rere. |
.error |
Tọkasi iṣẹ ti o lewu tabi agbara odi. |
.warning |
Tọkasi ikilọ ti o le nilo akiyesi. |
.info |
Lo bi yiyan si awọn aza aiyipada. |
# | Ọja | Owo sisan | Ipo |
---|---|---|---|
1 | TB - Oṣooṣu | 01/04/2012 | Ti fọwọsi |
2 | TB - Oṣooṣu | 02/04/2012 | Ti kọ |
3 | TB - Oṣooṣu | 03/04/2012 | Ni isunmọtosi |
4 | TB - Oṣooṣu | 04/04/2012 | Pe wọle lati jẹrisi |
- ...
- < tr kilasi = "aṣeyọri" >
- <td> 1 < /td>
- <td>TB - Oṣooṣu</ td >
- <td> 01 / 04 / 2012 < /td>
- <td>Ti a fọwọsi</ td >
- </ tr >
- ...
Akojọ awọn eroja HTML tabili atilẹyin ati bii o ṣe yẹ ki wọn lo.
Tag | Apejuwe |
---|---|
<table> |
Apo mimu fun fifi data han ni ọna kika tabular |
<thead> |
Apoti eroja fun awọn ori ila akọsori tabili ( <tr> ) lati ṣe aami awọn ọwọn tabili |
<tbody> |
Eiyan ano fun tabili awọn ori ila ( <tr> ) ninu awọn ara ti awọn tabili |
<tr> |
Eiyan eroja fun a ṣeto ti tabili awọn sẹẹli ( <td> tabi <th> ) ti o han lori kan nikan kana |
<td> |
Seli tabili aiyipada |
<th> |
Special tabili cell fun iwe (tabi kana, da lori dopin ati placement) aami |
<caption> |
Apejuwe tabi akopọ ohun ti tabili dimu, paapaa wulo fun awọn oluka iboju |
- <tabili>
- <apilẹṣẹ> ... </ikọ ọrọ>
- <ori>
- <tr>
- <th> ... </th>
- <th> ... </th>
- </tr>
- </ thead>
- <tbody>
- <tr>
- <td> ... </td>
- <td> ... </td>
- </tr>
- </tbody>
- </tabili>
Awọn iṣakoso fọọmu kọọkan gba iselona, ṣugbọn laisi eyikeyi kilasi ipilẹ ti a beere lori <form>
tabi awọn ayipada nla ni isamisi. Awọn abajade ni tolera, awọn aami ti o ni ibamu si osi lori awọn iṣakoso fọọmu.
- <fọọmu>
- <fi aaye>
- <arosọ> Àlàyé </ aroso>
- <aami> Orukọ aami </label>
- <input type = "text" placeholder = "Tẹ nkankan..." >
- <span class = "help-block" > Apẹẹrẹ ọrọ iranlọwọ ipele idina nibi. </span>
- < kilasi aami = "apoti" >
- <input type = "boxbox" > Ṣayẹwo mi
- </aami>
- <bọtini iru = "fi silẹ" kilasi = "btn" > Fi </button> silẹ
- </fieldset>
- </fọọmu>
To wa pẹlu Bootstrap jẹ awọn ipilẹ fọọmu iyan mẹta fun awọn ọran lilo wọpọ.
Ṣafikun .form-search
si fọọmu naa ati .search-query
si <input>
fun titẹ ọrọ ti o ni iyipo ni afikun.
- < kilasi fọọmu = "iwa-fọọmu" >
- <input type = "text" class = "input-medium search-query" >
- <button type = "fi silẹ" kilasi = "btn" > Ṣawari </button>
- </fọọmu>
Ṣafikun .form-inline
fun awọn akole ti o ni ibamu si apa osi ati awọn idari-idina laini fun iṣeto iwapọ.
- < kilaasi fọọmu = "fọọmu-ila" >
- <input type = "text" class = "input-small" placeholder = "Imeeli" >
- <input type = "ọrọ igbaniwọle" kilasi = "input-small" ibi ipamọ = "Ọrọigbaniwọle" >
- < kilasi aami = "apoti" >
- <input type = "boxbox" > Ranti mi
- </aami>
- <button type = "fi silẹ" kilasi = "btn" > Wọle </button>
- </fọọmu>
So awọn akole sọtun ki o leefofo loju omi si apa osi lati jẹ ki wọn han lori laini kanna bi awọn idari. Nilo awọn iyipada isamisi pupọ julọ lati fọọmu aiyipada:
.form-horizontal
si fọọmu naa.control-group
.control-label
si aami.controls
fun titete to dara
- < kilaasi fọọmu = "fọọmu-petele" >
- <div class = "ẹgbẹ iṣakoso" >
- < kilasi aami = "control-label" fun = "inputEmail" > Imeeli </label>
- <div kilasi = "awọn idari" >
- < oriṣi titẹ sii = "ọrọ" id = "inputEmail" ibi ipamọ = "Imeeli" >
- </div>
- </div>
- <div class = "ẹgbẹ iṣakoso" >
- <label class = "aami-iṣakoso" fun = "inputPassword" > Ọrọigbaniwọle </label>
- <div kilasi = "awọn idari" >
- < iru titẹ sii = "ọrọ igbaniwọle" id = "inputPassword" ibi ipamọ = "Ọrọigbaniwọle" >
- </div>
- </div>
- <div class = "ẹgbẹ iṣakoso" >
- <div kilasi = "awọn idari" >
- <aami kilasi aami = "apoti" >
- < oriṣi titẹ sii = "boxbox" > Ranti mi
- </aami>
- <bọtini iru = "fi silẹ" kilasi = "btn" > Wọle </button>
- </div>
- </div>
- </fọọmu>
Awọn apẹẹrẹ ti awọn iṣakoso fọọmu boṣewa ni atilẹyin ni ipilẹ fọọmu apẹẹrẹ.
Iṣakoso fọọmu ti o wọpọ julọ, awọn aaye igbewọle orisun-ọrọ. Pẹlu atilẹyin fun gbogbo awọn iru HTML5: ọrọ, ọrọ igbaniwọle, akoko ọjọ, aago-agbegbe, ọjọ, oṣu, akoko, ọsẹ, nọmba, imeeli, url, wiwa, tel, ati awọ.
Nbeere lilo ti pàtó kan type
ni gbogbo igba.
- <input type = "text" placeholder = "Igbewọle ọrọ" >
Iṣakoso fọọmu eyiti o ṣe atilẹyin awọn laini pupọ ti ọrọ. Yi rows
eroja pada bi o ṣe pataki.
- <textarea awọn ori ila = "3" > </textarea>
Awọn apoti ayẹwo jẹ fun yiyan ọkan tabi pupọ awọn aṣayan ninu atokọ lakoko ti awọn redio wa fun yiyan aṣayan kan lati ọpọlọpọ.
- < kilasi aami = "apoti" >
- < iru titẹ sii = "apoti apoti" iye = "" >
- Aṣayan ọkan ni eyi ati iyẹn — rii daju lati ṣafikun idi ti o fi dara
- </aami>
- < kilasi aami = "redio" >
- < iru igbewọle = "redio" orukọ = "optionsRadios" id = "optionsRadios1" iye = "aṣayan1" ṣayẹwo >
- Aṣayan ọkan ni eyi ati iyẹn — rii daju lati ṣafikun idi ti o fi dara
- </aami>
- < kilasi aami = "redio" >
- < iru igbewọle = "redio" orukọ = "optionsRadios" id = "optionsRadios2" iye = "aṣayan2" >
- Aṣayan keji le jẹ nkan miiran ati yiyan yoo yan aṣayan ọkan
- </aami>
Ṣafikun .inline
kilasi naa si lẹsẹsẹ awọn apoti ayẹwo tabi awọn redio fun awọn idari yoo han lori laini kanna.
- < kilasi aami = "inline apoti" >
- < iru igbewọle = "apoti apoti" id = "inlineCheckbox1" iye = "aṣayan1" > 1
- </aami>
- < kilasi aami = "inline apoti" >
- < Iru titẹ sii = "apoti apoti" id = "inlineCheckbox2" iye = "aṣayan2" > 2
- </aami>
- < kilasi aami = "inline apoti" >
- < Iru titẹ sii = "apoti apoti" id = "inlineCheckbox3" iye = "aṣayan3" > 3
- </aami>
Lo aṣayan aiyipada tabi pato kan multiple="multiple"
lati ṣafihan awọn aṣayan pupọ ni ẹẹkan.
- <yan>
- <aṣayan> 1 </aṣayan>
- <aṣayan> 2 </aṣayan>
- <aṣayan> 3 </aṣayan>
- <aṣayan> 4 </aṣayan>
- <aṣayan> 5 </aṣayan>
- </yan>
- <yan ọpọ = "ọpọlọpọ" >
- <aṣayan> 1 </aṣayan>
- <aṣayan> 2 </aṣayan>
- <aṣayan> 3 </aṣayan>
- <aṣayan> 4 </aṣayan>
- <aṣayan> 5 </aṣayan>
- </yan>
Ṣafikun lori awọn iṣakoso aṣawakiri ti o wa tẹlẹ, Bootstrap pẹlu awọn paati fọọmu miiran ti o wulo.
Ṣafikun ọrọ tabi awọn bọtini ṣaaju tabi lẹhin igbewọle orisun-ọrọ eyikeyi. Ṣe akiyesi pe select
awọn eroja ko ni atilẹyin nibi.
Fi ipari si .add-on
ati input
ọkan pẹlu ọkan ninu awọn kilasi meji lati ṣaju tabi fi ọrọ kun kikọ sii.
- <div class = "input-prepend" >
- <span class = "afikun-un" > @ </span>
- < class input = "span2" id = "prependedInput" type = "text" placeholder = "Orukọ olumulo" >
- </div>
- <div class = "input-append" >
- < class input = "span2" id = "appendedInput" iru = "ọrọ" >
- <span class = "afikun-un" > .00 </span>
- </div>
Lo awọn kilasi mejeeji ati awọn apẹẹrẹ meji .add-on
lati ṣaju ati fi ohun kikọ sii sii.
- <div class = "input-prepend input-append" >
- <span class = "afikun-un" > $ </span>
- < class input = "span2" id = "appendedPrependedInput" type = "ọrọ" >
- <span class = "afikun-un" > .00 </span>
- </div>
Dipo ti a <span>
pẹlu ọrọ, lo a .btn
lati so a bọtini (tabi meji) si ohun kikọ sii.
- <div class = "input-append" >
- < class input = "span2" id = "appendedInputButton" iru = "ọrọ" >
- <bọtini kilasi = "btn" type = "bọtini" > Lọ! </bọtini>
- </div>
- <div class = "input-append" >
- < class input = "span2" id = "appendedInputButtons" iru = "ọrọ" >
- <bọtini kilasi = "btn" type = "bọtini" > Wa </button>
- <bọtini kilasi = "btn" type = "bọtini" > Awọn aṣayan </button>
- </div>
- <div class = "input-append" >
- < class input = "span2" id = "appendedDropdownButton" iru = "ọrọ" >
- <div class = "btn-ẹgbẹ" >
- <bọtini kilasi = "btn dropdown-toggle" data-toggle = "silẹ silẹ" >
- Iṣe
- <span class = "abojuto" </span>
- </bọtini>
- <ul kilasi = "akojọ-silẹ silẹ" >
- ...
- </ul>
- </div>
- </div>
- <div class = "input-prepend" >
- <div class = "btn-ẹgbẹ" >
- <bọtini kilasi = "btn dropdown-toggle" data-toggle = "silẹ silẹ" >
- Iṣe
- <span class = "abojuto" </span>
- </bọtini>
- <ul kilasi = "akojọ-silẹ silẹ" >
- ...
- </ul>
- </div>
- < class input = "span2" id = "prependedDropdownButton" iru = "ọrọ" >
- </div>
- <div class = "input-prepend input-append" >
- <div class = "btn-ẹgbẹ" >
- <bọtini kilasi = "btn dropdown-toggle" data-toggle = "silẹ silẹ" >
- Iṣe
- <span class = "abojuto" </span>
- </bọtini>
- <ul kilasi = "akojọ-silẹ silẹ" >
- ...
- </ul>
- </div>
- < class input = "span2" id = "appendedPrependedDropdownButton" iru = "ọrọ" >
- <div class = "btn-ẹgbẹ" >
- <bọtini kilasi = "btn dropdown-toggle" data-toggle = "silẹ silẹ" >
- Iṣe
- <span class = "abojuto" </span>
- </bọtini>
- <ul kilasi = "akojọ-silẹ silẹ" >
- ...
- </ul>
- </div>
- </div>
- <fọọmu>
- <div class = "input-prepend" >
- <div class = "btn-group" > ... </div>
- < iru titẹ sii = "ọrọ" >
- </div>
- <div class = "input-append" >
- < iru titẹ sii = "ọrọ" >
- <div class = "btn-group" > ... </div>
- </div>
- </fọọmu>
- < kilasi fọọmu = "iwa-fọọmu" >
- <div class = "input-append" >
- <input type = "text" class = "span2 search-query" >
- <button type = "fi silẹ" kilasi = "btn" > Ṣawari </button>
- </div>
- <div class = "input-prepend" >
- <button type = "fi silẹ" kilasi = "btn" > Ṣawari </button>
- <input type = "text" class = "span2 search-query" >
- </div>
- </fọọmu>
Lo awọn kilasi iwọn ojulumo bii .input-large
tabi baramu awọn igbewọle rẹ si awọn iwọn ọwọn akoj nipa lilo .span*
awọn kilasi.
Jẹ ki eyikeyi <input>
tabi <textarea>
ano huwa bi a Àkọsílẹ ipele ano.
- <input class = "input-block-level" type = "text" placeholder = ".input-block-level" >
- < class input = "input-mini" type = "text" placeholder = ".input-mini" >
- <input class = "input-small" type = "text" placeholder = ".input-small" >
- < class input = "input-medium" type = "text" placeholder = ".input-medium" >
- < class input = "input-large" type = "text" placeholder = ".input-large" >
- < class input = "input-xlarge" type = "text" placeholder = ".input-xlarge" >
- < class input = "input-xxlarge" type = "text" placeholder = ".input-xxlarge" >
Efeti sile!Ni awọn ẹya iwaju, a yoo paarọ lilo awọn kilaasi igbewọle ibatan lati ba awọn iwọn bọtini wa mu. Fun apẹẹrẹ, .input-large
yoo mu fifẹ ati iwọn fonti ti titẹ sii.
Lo .span1
lati .span12
fun awọn igbewọle ti o baamu awọn iwọn kanna ti awọn ọwọn akoj.
- < kilasi igbewọle = "span1" type = "ọrọ" ibi ipamọ = ".span1" >
- < kilasi igbewọle = "span2" type = "ọrọ" ibi ipamọ = ".span2" >
- < kilasi igbewọle = "span3" type = "ọrọ" ibi ipamọ = ".span3" >
- < kilasi yan = "span1" >
- ...
- </yan>
- < kilasi yan = "span2" >
- ...
- </yan>
- < kilasi yan = "span3" >
- ...
- </yan>
Fun awọn igbewọle akoj pupọ fun laini, lo .controls-row
kilasi modifier fun aye to dara . O leefofo awọn igbewọle lati ṣubu-aaye funfun, ṣeto awọn ala to dara, o si sọ omi leefofo kuro.
- <div kilasi = "awọn idari" >
- < kilasi igbewọle = "span5" type = "ọrọ" ibi ipamọ = ".span5" >
- </div>
- <div class = "awọn idari-kana" >
- < kilasi igbewọle = "span4" type = "ọrọ" ibi ipamọ = ".span4" >
- < kilasi igbewọle = "span1" type = "ọrọ" ibi ipamọ = ".span1" >
- </div>
- ...
Ṣe afihan data ni fọọmu ti kii ṣe atunṣe laisi lilo isamisi fọọmu gangan.
- <span class = "input-xlarge uneditable-input" > Iye diẹ nibi </span>
Pari fọọmu kan pẹlu ẹgbẹ awọn iṣe (awọn bọtini). Nigbati a ba fi sii laarin awọn bọtini kan .form-actions
, awọn bọtini yoo tẹ sii laifọwọyi lati laini pẹlu awọn iṣakoso fọọmu.
- <div class = "awọn iṣe fọọmu" >
- <button type = "fi silẹ" kilasi = "btn btn-primary" > Fipamọ awọn ayipada </button>
- <bọtini iru = "bọtini" kilasi = "btn" > Fagilee </button>
- </div>
Opopo ati atilẹyin ipele idinamọ fun ọrọ iranlọwọ ti o han ni ayika awọn iṣakoso fọọmu.
- <input type = "text" ><span class = "help-inline" > Ọrọ iranlọwọ inu ila </span>
- <input type = "text" ><span class = "help-block" > Idina ọrọ iranlọwọ to gun ti o ya si laini tuntun ati pe o le fa kọja laini kan. </span>
Pese esi si awọn olumulo tabi awọn alejo pẹlu awọn ipinlẹ esi ipilẹ lori awọn iṣakoso fọọmu ati awọn akole.
A yọ awọn outline
aṣa aiyipada kuro lori diẹ ninu awọn iṣakoso fọọmu ati lo kan box-shadow
ni aaye rẹ fun :focus
.
- < class input = "input-xlarge" id = "focusedInput" type = "text" iye = "Eyi ni idojukọ..." >
Awọn igbewọle ara nipasẹ iṣẹ aṣawakiri aiyipada pẹlu :invalid
. Pato kan type
, ṣafikun required
abuda ti aaye ko ba jẹ iyan, ati (ti o ba wulo) pato kan pattern
.
Eyi ko si ni awọn ẹya ti Internet Explorer 7-9 nitori aini atilẹyin fun awọn yiyan afarape CSS.
- < class input = "span3" type = "imeeli" nilo >
Ṣafikun abuda naa disabled
lori titẹ sii lati ṣe idiwọ titẹ olumulo ati ṣe okunfa iwo ti o yatọ die-die.
- <input class = "input-xlarge" id = "disabledInput" type = "text" placeholder = "Igbewọle alaabo nibi..." alaabo >
Bootstrap pẹlu awọn ara afọwọsi fun aṣiṣe, ikilọ, alaye, ati awọn ifiranṣẹ aṣeyọri. Lati lo, ṣafikun kilasi ti o yẹ si agbegbe .control-group
.
- <div class = "ikilọ iṣakoso-ẹgbẹ" >
- <label class = "control-label" fun = "inputWarning" > Iṣawọle pẹlu ikilọ </label>
- <div kilasi = "awọn idari" >
- <input type = "text" id = "inputWarning" >
- <span class = "help-inline" > Nkankan le ti jẹ aṣiṣe </span>
- </div>
- </div>
- <div class = "aṣiṣe iṣakoso-ẹgbẹ" >
- <label class = "control-label" fun = "inputError" > Iṣwọle pẹlu aṣiṣe </label>
- <div kilasi = "awọn idari" >
- <input type = "text" id = "inputError" >
- <span class = "help-inline" > Jọwọ ṣe atunṣe aṣiṣe </span>
- </div>
- </div>
- <div class = "alaye ẹgbẹ iṣakoso" >
- <label class = "control-label" fun = "inputInfo" > Iṣawọle pẹlu alaye </label>
- <div kilasi = "awọn idari" >
- <input type = "ọrọ" id = "inputInfo" >
- <span class = "help-inline" > Orukọ olumulo ti gba tẹlẹ </span>
- </div>
- </div>
- <div class = "aṣeyọri iṣakoso-ẹgbẹ" >
- <label class = "control-label" fun = "inputSuccess" > Iṣawọle pẹlu aṣeyọri </label>
- <div kilasi = "awọn idari" >
- <input type = "ọrọ" id = "inputSuccess" >
- <span class = "help-inline" > Woohoo! </span>
- </div>
- </div>
Ṣafikun awọn kilasi si ipin <img>
kan si awọn aworan ara ni irọrun ni eyikeyi iṣẹ akanṣe.
- <img src = "..." kilasi = "img-yika" >
- <img src = "..." kilasi = "img-circle" >
- <img src = "..." kilasi = "img-polaroid" >
Efeti sile! .img-rounded
ati .img-circle
pe ko ṣiṣẹ ni IE7-8 nitori aini border-radius
atilẹyin.
Awọn aami 140 ni fọọmu sprite, wa ni grẹy dudu (aiyipada) ati funfun, ti a pese nipasẹ Glyphicons .
Glyphicons Halflings ni deede ko wa fun ọfẹ, ṣugbọn eto laarin Bootstrap ati awọn olupilẹṣẹ Glyphicons ti jẹ ki eyi ṣee ṣe laisi idiyele fun ọ bi awọn olupilẹṣẹ. Gẹgẹbi o ṣeun, a beere lọwọ rẹ lati ṣafikun ọna asopọ aṣayan pada si Glyphicons nigbakugba ti o wulo.
Gbogbo awọn aami nilo aami <i>
kan pẹlu kilasi alailẹgbẹ, ti a ti ṣaju pẹlu icon-
. Lati lo, gbe koodu atẹle yii si ibikibi:
- <i class = "icon-search" ></i>
Awọn aza tun wa fun awọn aami inverted (funfun), ti a ti ṣetan pẹlu kilasi afikun kan. A yoo ṣe pataki kilaasi yii lori gbigbe ati awọn ipinlẹ ti nṣiṣe lọwọ fun nav ati awọn ọna asopọ silẹ.
- <i class = "icon-search icon-white" </i>
Efeti sile!Nigbati o ba lo lẹgbẹẹ awọn gbolohun ọrọ, bi ninu awọn bọtini tabi awọn ọna asopọ nav, rii daju pe o fi aaye kan silẹ lẹhin <i>
tag fun aye to dara.
Lo wọn ni awọn bọtini, awọn ẹgbẹ bọtini fun ọpa irinṣẹ, lilọ kiri, tabi awọn igbewọle fọọmu ti a ti ṣetan.
- <div class = "btn-toolbar" >
- <div class = "btn-ẹgbẹ" >
- <a class = "btn" href = "#" ><i class = "icon-align-left" </i></a>
- <a class = "btn" href = "#" ><i class = "icon-align-center" </i></a>
- <a class = "btn" href = "#" ><i class = "icon-align-right" ></i></a>
- <a class = "btn" href = "#" ><i class = "icon-align-justify" </i></a>
- </div>
- </div>
- <div class = "btn-ẹgbẹ" >
- <a class = "btn btn-primary" href = "#" ><i class = "icon-user icon-white" ></i> Olumulo </a>
- <a class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" href = "#" ><span class = "abojuto" ></span></a>
- <ul kilasi = "akojọ-silẹ silẹ" >
- <li><a href = "#" ><i class = "icon-pencil" ></i> Ṣatunkọ </a></li>
- <li><a href = "#" ><i class = "icon-trash" ></i> Paarẹ </a></li>
- <li><a href = "#" ><i class = "icon-ban-circle" ></i> Gbese </a></li>
- <li kilasi = "olupin" </li>
- <li><a href = "#" ><i class = "i" ></i> Ṣe abojuto </a></li>
- </ul>
- </div>
- <a class = "btn btn-large" href = "#" ><i class = "icon-star" ></i> Irawọ </a>
- <a class = "btn btn-small" href = "#" ><i class = "icon-star" ></i> Irawọ </a>
- <a class = "btn btn-mini" href = "#" ><i class = "icon-star" ></i> Irawọ </a>
- <ul kilasi = "nav nav-akojọ" >
- <li class = "active" ><a href = "#" ><i class = "icon-home icon-white" ></i> Ile </a></li>
- <li><a href = "#" ><i class = "icon-book" >> Ile-ikawe </a></li>
- <li><a href = "#" ><i class = "icon-pencil" ></i> Awọn ohun elo </a></li>
- <li><a href = "#" ><i class = "i" ></i> Oriṣiriṣi </a> </li>
- </ul>
- <div class = "ẹgbẹ iṣakoso" >
- <label class = "control-label" fun = "inputIcon" > Adirẹsi imeeli </label>
- <div kilasi = "awọn idari" >
- <div class = "input-prepend" >
- <span class = " add-on" ><i class = "icon-envelope" </i></span>
- < class input = "span2" id = "inputIcon" iru = "ọrọ" >
- </div>
- </div>
- </div>