A saman zane-zane, abubuwan HTML na asali an tsara su kuma an inganta su tare da azuzuwan da za a iya ba da su don samar da sabo, daidaitaccen kama da ji.
Gabaɗayan grid ɗin rubutun yana dogara ne akan ƙananan ma'auni guda biyu a cikin masu canjin mu. Fayil maras kyau: @baseFontSize
da @baseLineHeight
. Na farko shine girman font-girman da aka yi amfani da shi duka kuma na biyu shine tsayin layin tushe.
Muna amfani da waɗancan sauye-sauye, da wasu maths, don ƙirƙira margins, paddings, da tsayin layi na kowane nau'in mu da ƙari.
Nullam quis risus eget urna mollis ornare vel eu leo. Duk da haka, muna magana ne game da abin ban dariya da kuma ban mamaki. Nullam id dolor id nibh ultricies vehicula.
Sanya sakin layi ya fice ta ƙara .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est ba commodo luctus.
Abun ciki | Amfani | Na zaɓi |
---|---|---|
<strong> |
Don jaddada gunkin rubutu da mahimmanci | Babu |
<em> |
Don jaddada guntun rubutu tare da damuwa | Babu |
<abbr> |
Ya nannade gajarta da gajartawa don nuna faffadan sigar akan shawagi | Haɗa sifa na zaɓi .initialism da aji don gajartawar manyan haruffa. |
<address> |
Don bayanin tuntuɓar kakansa na kusa ko dukan aikin | Ajiye tsarawa ta ƙare duk layi da<br> |
Fusce dapibus , tellus ac cursus commodo , tortor mauris condimentum nibh , ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.
Lura: Jin kyauta don amfani <b>
kuma <i>
a cikin HTML5, amma amfanin su ya ɗan canza kaɗan. <b>
ana nufin haskaka kalmomi ko jimloli ba tare da isar da ƙarin mahimmanci ba yayin <i>
da galibin murya ne, kalmomin fasaha, da sauransu.
Ga misalai guda biyu na yadda <address>
za a iya amfani da alamar:
Gajartawa tare da title
sifa suna da haske mai dige-gege na ƙasa da siginan taimako akan shawagi. Wannan yana ba masu amfani ƙarin nunin wani abu da za a nuna akan hover.
Ƙara initialism
ajin zuwa gajarce don ƙara daidaituwar rubutu ta hanyar ba shi ɗan ƙaramin girman rubutu.
HTML shine abu mafi kyau tun yankakken gurasa.
Gajartawar kalmar sifa ita ce attr .
Abun ciki | Amfani | Na zaɓi |
---|---|---|
<blockquote> |
Kashi-matakin toshe don faɗar abun ciki daga wani tushe | Ƙara .pull-left da .pull-right azuzuwan don zaɓuɓɓukan iyo |
<small> |
Abun zaɓi don ƙara ambato mai fuskantar mai amfani, yawanci marubuci mai taken aiki | Sanya <cite> kewayen take ko sunan tushen |
Don haɗa da blockquote, kunsa <blockquote>
kowane HTML azaman abin ƙira. Don madaidaiciyar magana muna ba da shawarar a <p>
.
Haɗa wani zaɓi na zaɓi <small>
don faɗi tushen ku kuma za ku sami dash —
a gabansa don dalilai na salo.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer yana da alaƙa da ante venenatis. </p>
- <small> Wani sanannen </small>
- </blockquote>
Tsohuwar blockquotes an tsara su kamar haka:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer yana da alaƙa da ante venenatis.
Wani shahararre a Jikin aiki
Don shawagi blockquote zuwa dama, ƙara class="pull-right"
:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer yana da alaƙa da ante venenatis.
Wani shahararre a Jikin aiki
<ul>
<ul class="unstyled">
<ol>
<dl>
<dl class="dl-horizontal">
A kula! Lissafin bayanin a kwance za su yanke sharuddan da suka yi tsayi da yawa don dacewa da ginshiƙi na hagu text-overflow
. A cikin kunkuntar wuraren kallo, za su canza zuwa tsayayyen shimfidar wuri.
Kunna snippets na layi tare da <code>
.
- Misali , < code> sashe </ code > yakamata a nade shi azaman layi .
Yi amfani <pre>
da layukan lamba da yawa. Tabbatar da kubuta daga kowane maƙallan kusurwa a cikin lambar don yin daidai.
<p>Sample rubutu a nan...</p>
- <pre>
- <p>Sample rubutu a nan...</p>
- </pre>
Lura: Tabbatar kiyaye lamba a cikin <pre>
alamun kusa da hagu kamar yadda zai yiwu; zai sanya duk shafuka.
Kuna iya ƙara .pre-scrollable
ajin da zaɓin wanda zai saita max-tsawo na 350px kuma ya ba da madaidaicin madaidaicin y-axis.
Ɗauki kashi iri <pre>
ɗaya kuma ƙara azuzuwan zaɓi biyu don ingantacciyar ma'ana.
- <p> Misalin rubutu a nan... </p>
- <pre class = "prettyprint
- linenums" >
- <p>Sample rubutu a nan...</p>
- </pre>
Zazzage google-code-prettify kuma duba readme don yadda ake amfani da su.
Tag | Bayani |
---|---|
<table> |
Nade kashi don nuna bayanai a cikin tsari na tabular |
<thead> |
Kayan kwantena don layuka na kan tebur ( <tr> ) don yiwa ginshiƙan tebur lakabi |
<tbody> |
Kayan kwantena don layuka na tebur ( <tr> ) a jikin teburin |
<tr> |
Kayan kwantena don saitin sel na tebur ( <td> ko <th> ) wanda ke bayyana akan layi ɗaya |
<td> |
Tantanin halitta na asali |
<th> |
Tantanin halitta na musamman don ginshiƙi (ko jere, dangane da iyaka da jeri) Dole ne a yi amfani da alamun a cikin a <thead> |
<caption> |
Bayani ko taƙaita abin da tebur ya ƙunsa, musamman masu amfani ga masu karanta allo |
- <tebur>
- <fito>
- <tr>
- <th> … </th>
- <th> … </th>
- </tr>
- </fadi>
- <tbody>
- <tr>
- <td> … </td>
- <td> … </td>
- </tr>
- </tbody>
- </text>
Suna | Class | Bayani |
---|---|---|
Tsohuwar | Babu | Babu salo, kawai ginshiƙai da layuka |
Na asali | .table |
Layukan kwance kawai tsakanin layuka |
An yi iyaka | .table-bordered |
Zagaye sasanninta kuma yana ƙara iyakar waje |
Zaki-tsari | .table-striped |
Yana ƙara launin haske mai launin toka mai haske zuwa layuka mara kyau (1, 3, 5, da sauransu) |
Natsuwa | .table-condensed |
Yanke fakitin tsaye cikin rabi, daga 8px zuwa 4px, cikin duka td da th abubuwa |
Ana yin salo ta atomatik tare da ƴan iyakoki don tabbatar da karantawa da kiyaye tsari. Tare da 2.0, .table
ana buƙatar aji.
- < class class = "tebur" >
- …
- </text>
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry | Tsuntsu |
Samun ɗan zato tare da tebur ɗinku ta ƙara zakin zebra - ƙara .table-striped
aji kawai.
Lura: Teburan da aka zare suna amfani da :nth-child
mai zaɓin CSS kuma babu shi a cikin IE7-IE8.
- < class class = "Table-stripped" >
- …
- </text>
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry | Tsuntsu |
Ƙara iyakoki kewaye da dukan teburi da sasanninta masu zagaye don dalilai na ado.
- < class class = "tebur mai iyaka" >
- …
- </text>
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
Alama | Otto | @getbootstrap | |
2 | Yakubu | Thornton | @mai |
3 | Larry the Bird |
Sanya tebur ɗin ku ya zama ƙarami ta ƙara .table-condensed
ajin don yanke fakitin tantanin halitta a rabi (daga 8px zuwa 4px).
- < class class = "Table-condensed" >
- …
- </text>
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry the Bird |
Jin kyauta don haɗa kowane azuzuwan tebur don cimma kamanni daban-daban ta amfani da kowane ɗayan darussan da ake da su.
- < class class = "Table-stried table-condensed table-condensed" >
- ...
- </text>
Cikakken suna | |||
---|---|---|---|
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry the Bird |
Mafi kyawun sashi game da fom a cikin Bootstrap shine cewa duk abubuwan shigar ku da abubuwan sarrafawa suna da kyau komai yadda kuka gina su a cikin alamarku. Ba a buƙatar babban HTML, amma muna samar da tsari ga waɗanda ke buƙatar sa.
Ƙarin rikitattun shimfidu suna zuwa tare da taƙaitattun azuzuwan da za a iya daidaita su don salo mai sauƙi da ɗaure taron, don haka ana rufe ku a kowane mataki.
Bootstrap ya zo tare da tallafi don nau'ikan shimfidu nau'i huɗu:
Daban-daban na shimfidu na tsari suna buƙatar wasu canje-canje don yin alama, amma abubuwan sarrafawa da kansu sun kasance kuma suna yin iri ɗaya.
Siffofin Bootstrap sun haɗa da salo don duk tushen tsarin sarrafawa kamar shigarwa, yanki, da zaɓin da kuke so. Amma kuma yana zuwa tare da adadin abubuwan da aka gyara na al'ada kamar abubuwan da aka haɗa da waɗanda aka riga aka tsara da kuma goyan bayan lissafin akwatuna.
Jihohi kamar kuskure, gargaɗi, da nasara an haɗa su don kowane nau'in sarrafa nau'i. Hakanan an haɗa da salo don sarrafa nakasassu.
Bootstrap yana ba da alama mai sauƙi da salo don salo huɗu na nau'ikan gidan yanar gizo gama gari.
Suna | Class | Bayani |
---|---|---|
A tsaye (tsoho) | .form-vertical (ba a buƙata) |
Maƙarƙashiya, alamun hagu akan sarrafawa |
Layin layi | .form-inline |
Alamar hagu da sarrafa toshe-layi don ƙaramin salo |
Bincika | .form-search |
Shigar da rubutu mai zagaye don ƙayataccen bincike na musamman |
A kwance | .form-horizontal |
Taso kan hagu, lambobi masu layi na dama akan layi ɗaya da masu sarrafawa |
Wayayye da ƙarancin nauyi ba tare da ƙarin alama ba.
- < class class = "da kyau" >
- <label> Lakabin suna </label>
- < nau'in shigarwa = "rubutu" aji = "span3" mai riƙewa = " Buga wani abu..." >
- <span class = "help-block" > Misalin rubutun taimako na matakin toshe anan. </span>
- < class class = "checkbox" >
- < nau'in shigarwa = "akwatin ajiya" > Duba ni
- </labarai>
- <button type = "submit" class = "btn" > Aika < /button>
- </form>
Ƙara .form-search
zuwa fom kuma .search-query
zuwa ga input
.
- < class class = "da kyau form-search" >
- < nau'in shigarwa = "rubutu" aji = "tambayoyin bincike-matsakaici" >
- <button type = "submit" class = "btn" > Bincika </button>
- </form>
Ƙara .form-inline
don ƙera jeri a tsaye da tazarar sarrafa nau'i.
- < class class = "to form-inline" >
- < nau'in shigarwa = "rubutu" aji = "input-small" mai sanya wuri = "Imel" >
- < nau'in shigarwa = "Password " aji = "shigar-small" mai sanya wuri = "Password" >
- < class class = "checkbox" >
- < nau'in shigarwa = "akwatin ajiya" > Ka tuna da ni
- </labarai>
- <button type = "submit" class = "btn" > Shiga </button>
- </form>
Ana nunawa a hannun dama duk tsoffin tsarin sarrafa fom da muke tallafawa. Ga jerin harsashi:
Idan aka ba da shimfidar sigar misali na sama, ga alamar da ke da alaƙa da shigarwar farko da ƙungiyar sarrafawa. Ana buƙatar .control-group
, .control-label
, da azuzuwan don salo..controls
- < class class = "form-horizontal" >
- <filaye>
- <labarin> Rubutun almara </legend>
- <div class = "control-group" >
- <label class = "control-label" don = "input01" > Shigar da rubutu </label>
- <div class = "controls" >
- < nau'in shigarwa = "rubutu" aji = "input-xlarge" id = "shigarwar01" >
- <p class = "help-block" > Taimakon rubutu </p>
- </div>
- </div>
- </fieldset>
- </form>
Bootstrap yana fasalta salo don mai da hankali mai goyan bayan mai lilo da disabled
jihohi. Muna cire tsohowar Webkit outline
kuma muna amfani da box-shadow
a wurin sa don :focus
.
Hakanan ya haɗa da salon tabbatarwa don kurakurai, faɗakarwa, da nasara. Don amfani, ƙara ajin kuskure zuwa kewaye .control-group
.
- <filaye
- class = "kuskuren rukuni-rukuni" >
- …
- </fieldset>
Ƙungiyoyin shigarwa-tare da rubutun da aka haɗa ko riga-kafi-suna samar da hanya mai sauƙi don ba da ƙarin mahallin abubuwan da kuka shigar. Manyan misalai sun haɗa da alamar @ don sunayen masu amfani da Twitter ko $ don kuɗi.
Har zuwa v1.4, Bootstrap yana buƙatar ƙarin alama a kusa da akwatunan bincike da rediyo don tara su. Yanzu, abu ne mai sauƙi na maimaita abin <label class="checkbox">
da ke kunshe da <input type="checkbox">
.
Hakanan ana tallafawa akwatunan rajistan layi da rediyo. Kawai ƙara .inline
zuwa kowane .checkbox
ko .radio
kuma kun gama.
Don amfani da prepend ko saka bayanai a cikin hanyar layi, tabbatar da sanya .add-on
kuma input
akan layi ɗaya, ba tare da sarari ba.
Don ƙara rubutun taimako don shigar da sigar ku, haɗa da rubutun taimakon layi tare da <span class="help-inline">
ko toshe rubutun taimako tare da <p class="help-block">
bayan ɓangaren shigarwar.
Maimakon yin kowane gunki ƙarin buƙatu, mun tattara su cikin sprite — tarin hotuna a cikin fayil ɗaya wanda ke amfani da CSS don sanya hotuna tare da background-position
. Wannan hanya ɗaya ce da muke amfani da ita akan Twitter.com kuma ta yi mana aiki da kyau.
Duk azuzuwan gumaka an riga an sanya su da su .icon-
don daidaita sunaye masu dacewa da ƙwanƙwasa, kamar sauran abubuwan haɗinmu. Wannan zai taimaka kauce wa rikice-rikice tare da wasu kayan aikin.
Glyphicons ya ba mu damar amfani da Halflings da aka saita a cikin buɗaɗɗen kayan aikin kayan aikin mu muddin mun samar da hanyar haɗi da ƙima anan a cikin takaddun. Da fatan za a yi la'akari da yin haka a cikin ayyukanku.
Bootstrap yana amfani da <i>
alamar ga duk gumaka, amma ba su da wani nau'i na shari'a - kawai prefix ɗin da aka raba. Don amfani, sanya lambar mai zuwa kusan ko'ina:
- <i class = "icon-search" >>
Hakanan akwai salo don gumaka masu jujjuya (fararen), waɗanda aka shirya tare da ƙarin aji ɗaya:
- <i class = " icon-search icon-white" ></i>
Akwai azuzuwan 140 da za a zaɓa daga don gumakanku. Kawai ƙara <i>
alama tare da azuzuwan da suka dace kuma an saita ku. Kuna iya samun cikakken jeri a sprites.less ko dama anan cikin wannan takarda.
A kula! Lokacin amfani da gefen zaren rubutu, kamar a cikin maɓallai ko mahaɗin mahaɗa, tabbatar da barin sarari bayan <i>
alamar don tazarar da ta dace.
Gumaka suna da kyau, amma a ina mutum zai yi amfani da su? Ga 'yan ra'ayoyi:
Mahimmanci, duk inda za ku iya sanya <i>
alama, kuna iya sanya gunki.
Yi amfani da su a cikin maɓallai, ƙungiyoyin maɓalli don kayan aiki, kewayawa, ko abubuwan da aka riga aka tsara.