CSS
Saitunan CSS na duniya, mahimman abubuwan HTML waɗanda aka tsara kuma an inganta su tare da azuzuwan da za a iya ƙarawa, da tsarin grid na ci gaba.
Saitunan CSS na duniya, mahimman abubuwan HTML waɗanda aka tsara kuma an inganta su tare da azuzuwan da za a iya ƙarawa, da tsarin grid na ci gaba.
Samun ƙarancin ƙasa a kan maɓalli na kayan aikin Bootstrap, gami da tsarinmu don inganta, sauri, haɓakar yanar gizo mai ƙarfi.
Bootstrap yana amfani da wasu abubuwan HTML da kaddarorin CSS waɗanda ke buƙatar amfani da tsarin HTML5. Hada shi a farkon duk ayyukan ku.
Tare da Bootstrap 2, mun ƙara salon abokantaka na zaɓi na wayar hannu don mahimman abubuwan tsarin. Tare da Bootstrap 3, mun sake rubuta aikin don zama abokantaka ta wayar hannu tun daga farko. Maimakon ƙara akan salon wayar hannu na zaɓi, ana gasa su kai tsaye. A zahiri, Bootstrap shine wayar hannu ta farko . Za a iya samun salon farko ta wayar hannu ko'ina cikin ɗakin karatu maimakon a cikin fayiloli daban-daban.
Don tabbatar da ma'ana mai kyau da taɓa zuƙowa, ƙara tag meta tag zuwa naku <head>
.
Kuna iya musaki damar zuƙowa akan na'urorin hannu ta ƙara user-scalable=no
zuwa tambarin kallo. Wannan yana hana zuƙowa, ma'ana masu amfani za su iya gungurawa kawai, kuma yana haifar da rukunin yanar gizon ku kamar aikace-aikacen asali. Gabaɗaya, ba mu ba da shawarar wannan akan kowane rukunin yanar gizo ba, don haka yi amfani da hankali!
Bootstrap yana saita ainihin nunin duniya, rubutun rubutu, da salon haɗin kai. Musamman, mu:
background-color: #fff;
akanbody
@font-family-base
, @font-size-base
, da @line-height-base
sifofi azaman tushen rubutun mu@link-color
kuma yi amfani da layin layi kawai a kan:hover
Ana iya samun waɗannan salon a ciki scaffolding.less
.
Don ingantacciyar ma'anar mai binciken giciye, muna amfani da Normalize.css , aikin Nicolas Gallagher da Jonathan Neal .
Bootstrap yana buƙatar wani abu mai ƙunshe don nannade abubuwan da ke cikin rukunin yanar gizo da gina tsarin grid ɗin mu. Kuna iya zaɓar ɗaya daga cikin kwantena biyu don amfani da su a cikin ayyukanku. Yi la'akari da cewa, saboda padding
da ƙari, ba kwantena ba ne mai tushe.
Yi amfani .container
da madaidaicin akwati mai faɗi mai amsawa.
Yi amfani .container-fluid
da akwati don cikakken faɗin ganga, mai faɗi duka faɗin wurin kallon ku.
Bootstrap ya haɗa da tsarin grid na ruwa na farko na wayar hannu wanda ya dace da sikeli har zuwa ginshiƙai 12 yayin da na'urar ko girman kallon kallo ke ƙaruwa. Ya haɗa da azuzuwan da aka ƙirƙira don zaɓuɓɓukan shimfidawa masu sauƙi, da kuma haɗaɗɗun haɗaɗɗiya masu ƙarfi don samar da ƙarin shimfidu na tamani .
Ana amfani da tsarin grid don ƙirƙirar shimfidar shafi ta hanyar jerin layuka da ginshiƙai waɗanda ke ɗaukar abun cikin ku. Ga yadda tsarin grid Bootstrap ke aiki:
.container
(daidaitacce-nisa) ko .container-fluid
(cikakken nisa) don daidaitawa da manne..row
kuma .col-xs-4
ana samun su don yin shimfiɗin grid da sauri. Hakanan za'a iya amfani da ƙananan mixins don ƙarin shimfidu na ma'ana.padding
. Wannan padding ɗin ana kashe shi a cikin layuka na shafi na farko da na ƙarshe ta hanyar ragi mara kyau akan .row
s..col-xs-4
..col-md-*
aji zuwa kashi ba kawai zai shafi salon sa akan matsakaicin na'urori ba har ma da manyan na'urori idan .col-lg-*
aji ba ya nan.Dubi misalan don amfani da waɗannan ƙa'idodin zuwa lambar ku.
Muna amfani da tambayoyin kafofin watsa labaru masu zuwa a cikin Ƙananan fayilolin mu don ƙirƙirar maɓalli na maɓalli a cikin tsarin mu.
Wani lokaci muna faɗaɗa waɗannan tambayoyin kafofin watsa labarai don haɗawa max-width
don iyakance CSS zuwa ƙananan na'urori.
Dubi yadda sassan tsarin grid na Bootstrap ke aiki a cikin na'urori da yawa tare da tebur mai amfani.
Ƙarin ƙananan na'urori wayoyi (<768px) | Ƙananan na'urori Allunan (≥768px) | Matsakaicin na'urori Desktops (≥992px) | Manyan Desktops (≥1200px) | |
---|---|---|---|---|
Halin grid | A kwance a kowane lokaci | Rushewa don farawa, a kwance sama da wuraren karya | ||
Faɗin kwantena | Babu (atomatik) | 750px ku | 970px ku | 1170px |
Gaban aji | .col-xs- |
.col-sm- |
.col-md- |
.col-lg- |
# na ginshiƙai | 12 | |||
Faɗin ginshiƙi | Mota | ~ 62px | ~81px | ~97px |
Faɗin gutter | 30px (15px a kowane gefen shafi) | |||
Nestable | Ee | |||
Matsaloli | Ee | |||
Yin odar ginshiƙi | Ee |
Yin amfani da saiti guda ɗaya na .col-md-*
azuzuwan grid, zaku iya ƙirƙirar tsarin grid na asali wanda ke farawa daga kan na'urorin hannu da na'urorin kwamfutar hannu (ƙarin ƙarami zuwa ƙarami) kafin ya zama kwance akan na'urorin tebur (matsakaici). Sanya ginshiƙan grid a kowane .row
.
Juya kowane ƙayyadadden shimfidar grid mai faɗi zuwa shimfidar faɗin faɗin ta hanyar canza mafi girman ku .container
zuwa .container-fluid
.
Ba sa son ginshiƙan ku su taru a cikin ƙananan na'urori? Yi amfani da ƙarin ƙananan da matsakaitan azuzuwan grid na na'ura ta ƙara .col-xs-*
.col-md-*
zuwa ginshiƙan ku. Dubi misalin da ke ƙasa don kyakkyawan ra'ayi na yadda duk yake aiki.
Gina a kan misalin da ya gabata ta ƙirƙirar madaidaicin tsari mai ƙarfi da ƙarfi tare da .col-sm-*
azuzuwan kwamfutar hannu.
Idan an sanya fiye da ginshiƙai 12 a cikin jere ɗaya, kowane rukuni na ƙarin ginshiƙai, a matsayin raka'a ɗaya, za su naɗe kan sabon layi.
Tare da matakan grid huɗu da ke akwai za ku daure ku shiga cikin al'amurra inda, a wasu wuraren hutu, ginshiƙan ku ba su bayyana daidai kamar yadda ɗayan ya fi ɗayan tsayi. Don gyara wannan, yi amfani da haɗin haɗin a da azuzuwan aikin.clearfix
mu masu amsawa .
Baya ga sharewar ginshiƙi a wuraren karyewa, ƙila ka buƙaci sake saiti, turawa, ko ja . Dubi wannan a aikace a cikin misalin grid .
Matsar da ginshiƙai zuwa dama ta amfani .col-md-offset-*
da azuzuwan. Waɗannan azuzuwan suna ƙara gefen hagu na shafi ta *
ginshiƙai. Misali, .col-md-offset-4
yana motsawa .col-md-4
sama da ginshiƙai huɗu.
Hakanan zaka iya soke gyare-gyare daga ƙananan matakan grid tare da .col-*-offset-0
azuzuwan.
Don shigar da abun cikin ku tare da tsoho grid, ƙara sabon .row
da saitin .col-sm-*
ginshiƙai a cikin .col-sm-*
ginshiƙi da ke akwai. Layukan da aka kafa yakamata su haɗa da saitin ginshiƙai waɗanda suka haɗa har zuwa 12 ko ƙasa da haka (ba a buƙatar ku yi amfani da duk ginshiƙai 12 da ake da su ba).
Sauƙaƙan canza tsarin ginshiƙan grid ɗin mu tare .col-md-push-*
da .col-md-pull-*
azuzuwan masu gyara.
Baya ga azuzuwan grid da aka riga aka gina don shimfidu masu sauri, Bootstrap ya haɗa da Ƙananan masu canji da mahaɗa don samar da naku mai sauƙi, shimfidu na natsuwa.
Masu canji suna ƙayyade adadin ginshiƙai, faɗin gutter, da wurin tambayar kafofin watsa labarai inda za a fara ginshiƙai masu iyo. Muna amfani da waɗannan don samar da azuzuwan grid da aka riga aka rubuta a sama, da kuma ga mahaɗin al'ada da aka jera a ƙasa.
Ana amfani da Mixins tare da masu canjin grid don samar da CSS na ma'ana don ginshiƙan grid ɗaya ɗaya.
Kuna iya canza masu canji zuwa dabi'un al'ada na ku, ko kawai amfani da mixins tare da tsoffin ƙimar su. Anan ga misalin amfani da saitunan tsoho don ƙirƙirar shimfidar ginshiƙi biyu tare da tazara tsakanin.
Duk kanun HTML, <h1>
ta hanyar <h6>
, akwai su. .h1
Hakanan ana samun ta hanyar .h6
azuzuwan, don lokacin da kuke son daidaita salon rubutun rubutu amma har yanzu kuna son a nuna rubutun ku ta layi.
h1. Bootstrap jagora |
Semibold 36px |
h2. Bootstrap jagora |
Semibold 30px |
h3. Bootstrap jagora |
Semibold 24px |
h4. Bootstrap jagora |
Semibold 18px |
h5. Bootstrap jagora |
Semibold 14px |
h6. Bootstrap jagora |
Semibold 12px |
Ƙirƙiri ƙarami, rubutu na sakandare a cikin kowane taken tare da jigon jigon <small>
ko .small
aji.
h1. Bootstrap kan rubutun Sakandare |
h2. Bootstrap kan rubutun Sakandare |
h3. Bootstrap jagora rubutun Sakandare |
h4. Bootstrap jagora rubutun Sakandare |
h5. Bootstrap jagora rubutun Sakandare |
h6. Bootstrap kan rubutun Sakandare |
Tsoffin duniya na Bootstrap font-size
shine 14px , tare da line-height
na 1.428 . Ana amfani da wannan a cikin <body>
da kuma duk sakin layi. Bugu da kari, <p>
(sakin layi) suna karɓar gefen ƙasa na rabin tsayin layin da aka ƙididdige su (10px ta tsohuwa).
Nullam quis risus eget urna mollis ornare vel eu leo. Duk da haka, muna magana ne game da abin ban mamaki da kuma ban mamaki. Nullam id dolor id nibh ultricies vehicula.
Duk da haka, muna magana ne game da abin ban mamaki da kuma ban mamaki. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id un mi porta gravida a eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Sanya sakin layi ya fice ta ƙara .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est ba commodo luctus.
Ma'aunin rubutu ya dogara ne akan ƙananan ma'auni guda biyu a cikin masu canji . kasa : @font-size-base
da @line-height-base
. 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-sauyen da wasu sassauƙan lissafi don ƙirƙira margins, paddings, da tsayin layi na kowane nau'in mu da ƙari. Keɓance su kuma Bootstrap ya daidaita.
Don haskaka gudu na rubutu saboda dacewarsa a wani mahallin, yi amfani da <mark>
alamar.
Kuna iya amfani da alamar alamar zuwahaskakawarubutu.
Don nuna tubalan rubutun da aka goge yi amfani da <del>
alamar.
Wannan layin rubutun ana nufin a kula dashi azaman rubutun da aka goge.
Don nuna tubalan rubutu waɗanda ba su dace ba yi amfani da <s>
alamar.
Wannan layin rubutun ana nufin a bi da shi kamar yadda ba daidai ba ne.
Don nuna ƙari ga daftarin aiki yi amfani da <ins>
alamar.
Wannan layin rubutun ana nufin a kula dashi azaman ƙari ga takaddar.
Don layi layi da rubutu yi amfani da <u>
alamar.
Wannan layin rubutun zai fassara kamar yadda aka ja layi
Yi amfani da tsoffin alamun girmamawa na HTML tare da salo marasa nauyi.
Don rage jaddada layin layi ko tubalan rubutu, yi amfani da <small>
alamar don saita rubutu a 85% girman iyaye. Abubuwan kan gaba suna karɓar nasu font-size
don gida<small>
abubuwan gida.
Hakanan zaka iya amfani da kashi na layi tare da .small
maimakon kowane <small>
.
Wannan layin rubutun ana nufin a kula dashi azaman bugu mai kyau.
Don jaddada guntun rubutu tare da nauyin rubutu mai nauyi.
Ana fassara gunkin rubutu mai zuwa azaman rubutu mai ƙarfi .
Don jaddada guntun rubutu tare da rubutun.
Ana fassara gunkin rubutu mai zuwa azaman rubutun rubutun .
Jin kyauta don amfani <b>
kuma <i>
a cikin HTML5. <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.
Sauƙaƙe daidaita rubutu zuwa sassa tare da azuzuwan daidaita rubutu.
Rubutun hagu masu layi.
Rubutun da aka daidaita a tsakiya.
Rubutun daidaitacce.
Maganar gaskiya.
Babu rubutu na kunsa.
Canza rubutu a cikin sassa tare da azuzuwan babban rubutu.
Ƙananan rubutu.
Rubutun babba.
Babban rubutu.
Salon aiwatar da abubuwan HTML <abbr>
don gajartawa da gajarta don nuna faɗaɗɗen sigar akan hover. Gajartawa tare da title
sifa suna da iyakar haske mai dige-dige na ƙasa da mai siginar taimako akan shawagi, yana ba da ƙarin mahallin akan shawagi da masu amfani da fasahar taimako.
Gajartawar kalmar sifa ita ce attr .
Ƙara .initialism
zuwa ga taƙaitaccen girman girman rubutu kaɗan.
HTML shine abu mafi kyau tun yankakken gurasa.
Gabatar da bayanin tuntuɓar kakanni mafi kusa ko duka aikin. Ajiye tsarawa ta ƙare duk layi da <br>
.
Don faɗar tubalan abun ciki daga wani tushe a cikin takaddar ku.
Kunna <blockquote>
kowane HTML a matsayin zance. Don madaidaiciyar magana, muna ba da shawarar a <p>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ƙididdigar ƙididdiga ta ƙididdigewa.
Salo da abun ciki suna canzawa don sauƙaƙan bambancin akan ma'auni <blockquote>
.
Ƙara wani <footer>
don gano tushen. Kunna sunan tushen aikin a cikin <cite>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ƙididdigar ƙididdiga ta ƙididdigewa.
Ƙara .blockquote-reverse
don blockquote tare da abun ciki mai daidaita daidai.
Jerin abubuwan da odar ba ta da mahimmanci a bayyane.
Jerin abubuwan da odar ke da mahimmanci a bayyane.
Cire tsoho list-style
da gefen hagu akan abubuwan jeri (yara nan take kawai). Wannan kawai ya shafi jerin abubuwa na yara nan da nan , ma'ana kuna buƙatar ƙara ajin don kowane jeri na gida kuma.
Sanya duk abubuwan jeri akan layi guda tare display: inline-block;
da wasu fakitin haske.
Jerin sharuɗɗan tare da kwatancensu masu alaƙa.
Yi sharuddan da kwatance a <dl>
layi gefe-gefe. Yana farawa a jeri kamar tsoho <dl>
s, amma lokacin da navbar ya faɗaɗa, haka yi waɗannan.
Lissafin bayanin a kwance za su yanke sharuddan da suka yi tsayi da yawa don dacewa da ginshiƙin hagu tare da text-overflow
. A cikin kunkuntar wuraren kallo, za su canza zuwa tsayayyen shimfidar wuri.
Kunna snippets na layi tare da <code>
.
<section>
ya kamata a nannade shi azaman layi.
Yi amfani da <kbd>
alamar shigarwar da aka saba shigar da ita ta madannai.
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>
Kuna iya ƙara .pre-scrollable
ajin da zaɓin, wanda zai saita max-tsawo na 350px kuma ya ba da madaidaicin madaidaicin y-axis.
Don nuna masu canji yi amfani da<var>
alamar.
y = m x + b
Don nuna tubalan samfurin fitarwa daga shirin yi amfani da <samp>
alamar.
Ana nufin ɗaukar wannan rubutu azaman samfurin fitarwa daga shirin kwamfuta.
Don salo na asali — padding haske da masu rarraba a kwance kawai - ƙara ajin tushe .table
zuwa kowane <table>
. Yana iya zama da wahala sosai, amma idan aka ba da yawan amfani da teburi don wasu plugins kamar kalanda da masu zaɓen kwanan wata, mun zaɓi ware salon teburin mu na al'ada.
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry | Tsuntsu |
Yi amfani .table-striped
don ƙara zakin zebra zuwa kowane jere na tebur a cikin <tbody>
.
Ana yin salo ta hanyar :nth-child
zaɓen CSS, wanda babu shi a cikin Internet Explorer 8.
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry | Tsuntsu |
Ƙara .table-bordered
don iyakoki a duk bangarorin tebur da sel.
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry | Tsuntsu |
Ƙara .table-hover
don kunna yanayin jujjuyawa akan layuka na tebur a cikin <tbody>
.
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry | Tsuntsu |
Ƙara .table-condensed
don sanya tebur ɗin ya zama ƙarami ta hanyar yankan tantanin halitta a rabi.
# | Sunan rana | Sunan mahaifa | Sunan mai amfani |
---|---|---|---|
1 | Alama | Otto | @mdo |
2 | Yakubu | Thornton | @mai |
3 | Larry the Bird |
Yi amfani da azuzuwan mahallin don canza launi na tebur ko sel guda ɗaya.
Class | Bayani |
---|---|
.active |
Yana amfani da launi mai jujjuyawa zuwa wani jere ko tantanin halitta |
.success |
Yana nuna aiki mai nasara ko tabbatacce |
.info |
Yana nuna tsaka tsaki canji ko aiki |
.warning |
Yana nuna gargaɗin da zai buƙaci kulawa |
.danger |
Yana nuna wani aiki mai haɗari ko mai yuwuwa mara kyau |
# | Hanyar shafi | Hanyar shafi | Hanyar shafi |
---|---|---|---|
1 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
2 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
3 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
4 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
5 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
6 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
7 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
8 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
9 | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi | Abubuwan da ke cikin ginshiƙi |
Yin amfani da launi don ƙara ma'ana a layin tebur ko tantanin halitta ɗaya kawai yana ba da alamar gani, wanda ba za a isar da shi ga masu amfani da fasahar taimako ba - kamar masu karanta allo. Tabbatar cewa bayanin da launi ke nunawa ko dai a bayyane yake daga abubuwan da ke cikin kanta (rubutun da ake iya gani a cikin layin tebur da ya dace), ko kuma an haɗa su ta hanyar madadin, kamar ƙarin rubutu da ke ɓoye tare da .sr-only
ajin.
Ƙirƙirar tebur masu amsawa ta hanyar naɗa kowane .table
ciki .table-responsive
don sanya su gungurawa a kwance akan ƙananan na'urori (a ƙarƙashin 768px). Lokacin duba akan wani abu mafi girma fiye da faɗin 768px, ba za ku ga wani bambanci a cikin waɗannan teburin ba.
Tables masu amsawa suna amfani da overflow-y: hidden
, wanda ke cire duk wani abun ciki wanda ya wuce ƙasa ko saman saman teburin. Musamman, wannan na iya kashe menus na zazzagewa da sauran widgets na ɓangare na uku.
Firefox yana da wasu salo mai ban sha'awa na filin da ya ƙunshi width
wanda ke tsangwama tare da tebur mai amsawa. Ba za a iya soke wannan ba tare da takamaiman hack na Firefox wanda ba mu bayar a Bootstrap ba:
Don ƙarin bayani, karanta wannan Amsar Tarin Ruwa .
# | Taken tebur | Taken tebur | Taken tebur | Taken tebur | Taken tebur | Taken tebur |
---|---|---|---|---|---|---|
1 | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta |
2 | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta |
3 | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta |
# | Taken tebur | Taken tebur | Taken tebur | Taken tebur | Taken tebur | Taken tebur |
---|---|---|---|---|---|---|
1 | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta |
2 | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta |
3 | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta | Tantanin halitta |
Sarrafa nau'ikan nau'ikan mutum ɗaya suna karɓar wasu salo ta duniya ta atomatik. Duk rubutun <input>
, <textarea>
, da <select>
abubuwa masu .form-control
an saita su width: 100%;
ta tsohuwa. Kunna lakabi da sarrafawa .form-group
don mafi kyawun tazara.
Kar a haxa ƙungiyoyin tsari kai tsaye tare da ƙungiyoyin shigarwa . Madadin haka, gida rukunin shigarwa a cikin rukunin tsari.
Ƙara .form-inline
zuwa fom ɗin ku (wanda ba dole ba ne ya zama a <form>
) don sarrafawar katanga-launi da hagu. Wannan kawai ya shafi fom a cikin wuraren kallo waɗanda ke da faɗin akalla 768px.
Abubuwan shigarwa da zaɓaɓɓun an width: 100%;
yi amfani da su ta tsohuwa a cikin Bootstrap. A cikin siffofin layi, mun sake saita cewa don width: auto;
haka sarrafawa da yawa zasu iya zama akan layi ɗaya. Dangane da shimfidar ku, ana iya buƙatar ƙarin faɗin al'ada.
Masu karatun allo za su sami matsala da fom ɗinku idan ba ku haɗa da lakabin kowane shigarwa ba. Don waɗannan nau'ikan layi, zaku iya ɓoye alamun ta amfani da .sr-only
ajin. Akwai ƙarin hanyoyin hanyoyin samar da lakabi don fasahar taimako, kamar aria-label
, aria-labelledby
ko title
sifa. Idan babu ɗaya daga cikin waɗannan, masu karatun allo za su iya yin amfani da placeholder
sifa, idan akwai, amma lura cewa placeholder
ba a ba da shawarar yin amfani da azaman madadin wasu hanyoyin yin lakabi ba.
Yi amfani da azuzuwan grid ɗin da aka ayyana Bootstrap don daidaita lakabi da ƙungiyoyin sarrafa nau'i a cikin shimfidar wuri ta ƙara .form-horizontal
zuwa tsari (wanda ba dole ba ne ya zama <form>
). Yin haka yana canza .form-group
s don yin aiki azaman layuka, don haka babu buƙatar .row
.
Misalai na daidaitattun sarrafa nau'i masu goyan baya a cikin shimfidar tsari na misali.
Mafi yawan sarrafa nau'i na gama gari, filayen shigarwa na tushen rubutu. Ya haɗa da tallafi ga kowane nau'in HTML5: text
, password
, datetime
, datetime-local
, date
, month
, time
, , week
, number
, email
, url
, search
, tel
, da color
.
Abubuwan da aka shigar za a cika su ne kawai idan type
an bayyana su da kyau.
Don ƙara haɗe-haɗen rubutu ko maɓalli kafin da/ko bayan kowane tushen rubutu <input>
, duba ɓangaren shigar da ƙungiyar .
Ikon tsari wanda ke goyan bayan layukan rubutu da yawa. Canja rows
sifa kamar yadda ya cancanta.
Akwatunan rajista don zaɓar ɗaya ko zaɓuɓɓuka da yawa a cikin jeri, yayin da rediyo ke zaɓar zaɓi ɗaya daga mutane da yawa.
Ana goyan bayan akwatunan rajistan shiga da radiyo, amma don samar da siginan "ba a yarda ba" akan karkatar da iyaye <label>
, kuna buƙatar ƙara .disabled
ajin ga iyaye .radio
, .radio-inline
, .checkbox
, ko .checkbox-inline
.
Yi amfani da .checkbox-inline
ko .radio-inline
azuzuwan akan jerin akwatuna ko radiyo don sarrafawa waɗanda ke bayyana akan layi ɗaya.
Idan ba ku da rubutu a cikin <label>
, an sanya shigarwar kamar yadda kuke tsammani. A halin yanzu yana aiki akan akwatunan rajistan shiga da rediyo marasa layi. Ka tuna har yanzu samar da wani nau'i na lakabin don fasahar taimako (misali, ta amfani da aria-label
).
Lura cewa yawancin zaɓin menu na asali - wato a cikin Safari da Chrome - suna da sasanninta da ba za a iya canzawa ta hanyar border-radius
kaddarorin ba.
Don <select>
sarrafawa tare da multiple
sifa, ana nuna zaɓuɓɓuka da yawa ta tsohuwa.
Lokacin da kake buƙatar sanya rubutu a sarari kusa da lakabin tsari a cikin fom, yi amfani da .form-control-static
ajin akan <p>
.
Muna cire tsoffin outline
sifofi akan wasu nau'ikan sarrafawa kuma muna amfani da box-shadow
a wurin sa don :focus
.
:focus
Jihar demoShigar da misalin da ke sama yana amfani da salo na al'ada a cikin takaddun mu don nuna :focus
jihar akan .form-control
.
Ƙara disabled
sifa ta boolean akan shigarwa don hana hulɗar mai amfani. Abubuwan da aka kashe sun bayyana sun fi sauƙi kuma suna ƙara not-allowed
siginan kwamfuta.
Ƙara disabled
sifa zuwa <fieldset>
don kashe duk abubuwan sarrafawa a cikin <fieldset>
lokaci ɗaya.
<a>
Ta hanyar tsoho, masu bincike za su kula da duk sarrafa nau'i na asali ( <input>
, <select>
da <button>
abubuwa) a cikin <fieldset disabled>
nakasassu, suna hana mu'amalar madannai da linzamin kwamfuta a kansu. Koyaya, idan fom ɗin ku kuma ya haɗa da <a ... class="btn btn-*">
abubuwa, waɗannan za a ba su salon pointer-events: none
. Kamar yadda aka gani a cikin sashin game da yanayin nakasa don maɓalli (kuma musamman a cikin ƙaramin yanki don abubuwan anga), wannan kadarar CSS ba ta riga ta daidaita ba kuma ba ta da cikakken tallafi a cikin Opera 18 da ƙasa, ko a cikin Internet Explorer 11, kuma ta ci nasara. 't hana masu amfani da madannai damar mayar da hankali ko kunna waɗannan hanyoyin haɗin. Don haka don zama lafiya, yi amfani da JavaScript na al'ada don kashe irin waɗannan hanyoyin haɗin.
Yayin da Bootstrap zai yi amfani da waɗannan salon a cikin duk masu bincike, Internet Explorer 11 da ƙasa ba sa cikakken goyon bayan disabled
sifa akan <fieldset>
. Yi amfani da JavaScript na al'ada don kashe saitin filin a cikin waɗannan masu binciken.
Ƙara readonly
sifa ta boolean akan shigarwa don hana gyara ƙimar shigarwar. Abubuwan da ake karantawa kawai suna bayyana masu sauƙi (kamar abubuwan da aka kashe), amma suna riƙe daidaitaccen siginan kwamfuta.
Toshe matakin taimakon rubutu don sarrafa tsari.
Rubutun taimako ya kamata a haɗa shi a fili tare da sarrafa nau'i wanda ya shafi amfani da aria-describedby
sifa. Wannan zai tabbatar da cewa fasahar taimako - kamar masu karanta allo - za su sanar da wannan rubutun taimako lokacin da mai amfani ya mai da hankali ko shigar da sarrafawa.
Bootstrap ya haɗa da salon tabbatarwa don kuskure, faɗakarwa, da jihohin nasara akan sarrafa tsari. Don amfani, ƙara .has-warning
, .has-error
, ko .has-success
zuwa kashi na iyaye. Kowane .control-label
, .form-control
, kuma .help-block
a cikin wannan kashi zai karɓi salon tabbatarwa.
Yin amfani da waɗannan salon tabbatarwa don nuna yanayin sarrafa nau'i kawai yana ba da alamar gani, alamar launi, wanda ba za a isar da shi ga masu amfani da fasahar taimako ba - kamar masu karanta allo - ko ga masu amfani da makafi.
Tabbatar cewa an samar da wata madaidaicin alamar jihar. Misali, zaku iya haɗa da alama game da jiha a cikin <label>
rubutun sarrafa nau'i da kanta (kamar yadda yake a cikin misalin lambar da ke gaba), haɗa da Glyphicon (tare da madadin rubutu mai dacewa ta amfani da .sr-only
aji - duba misalan Glyphicon ), ko ta hanyar samar da ƙarin toshe rubutun taimako . Musamman don fasahohin taimako, ana iya sanya madaidaitan tsari mara inganci aria-invalid="true"
.
Hakanan zaka iya ƙara gumakan martani na zaɓi tare da ƙari .has-feedback
da gunkin dama.
Gumakan amsawa suna aiki tare da <input class="form-control">
abubuwan rubutu kawai.
Ana buƙatar sanya gumakan martani da hannu don abubuwan shigarwa ba tare da lakabi ba kuma don ƙungiyoyin shigarwa tare da ƙari akan dama. Ana ƙarfafa ku sosai don samar da takubba don duk abubuwan da aka shigar don dalilai masu isa. Idan kuna son hana alamun nunawa, ɓoye su tare da .sr-only
ajin. Idan dole ne ku yi ba tare da takalmi ba, daidaita top
darajar gunkin martani. Don ƙungiyoyin shigarwa, daidaita right
ƙimar zuwa ƙimar pixel da ta dace dangane da faɗin addon ku.
Don tabbatar da cewa fasahar taimako - kamar masu karanta allo - suna isar da ma'anar gunki daidai, ƙarin ɓoyayyun rubutu yakamata a haɗa shi tare da .sr-only
ajin kuma a haɗe shi a sarari tare da sarrafa nau'ikan da ke da alaƙa da amfani aria-describedby
. A madadin, tabbatar da cewa ma'anar (misali, gaskiyar cewa akwai gargadi ga wani filin shigar da rubutu) an isar da shi ta wani nau'i daban-daban, kamar canza rubutun ainihin <label>
alaƙa da sarrafa nau'i.
Ko da yake waɗannan misalan sun riga sun ambaci yanayin tabbatarwa na nau'ikan sarrafa nau'ikan su a cikin <label>
rubutun kanta, dabarar da ke sama (ta amfani .sr-only
da rubutu da aria-describedby
) an haɗa su don dalilai na misali.
.sr-only
Gumaka na zaɓi tare da alamun ɓoyeIdan kayi amfani da .sr-only
ajin don ɓoye nau'i mai sarrafa nau'i <label>
(maimakon amfani da wasu zaɓuɓɓukan lakabi, kamar aria-label
sifa), Bootstrap zai daidaita matsayin gunkin ta atomatik da zarar an ƙara shi.
Saita tsayi ta amfani da azuzuwan kamar .input-lg
, kuma saita faɗin ta amfani da azuzuwan grid kamar .col-lg-*
.
Ƙirƙirar sarrafa tsari mai tsayi ko gajere wanda ya dace da girman maɓalli.
Girman lakabi da sauri da samar da sarrafawa a ciki .form-horizontal
ta ƙara .form-group-lg
ko .form-group-sm
.
Kunna abubuwan shiga cikin ginshiƙan grid, ko kowane ɓangaren iyaye na al'ada, don aiwatar da nisa da ake so cikin sauƙi.
Yi amfani da azuzuwan maɓalli akan <a>
, <button>
, ko <input>
kashi.
Yayin da za a iya amfani da azuzuwan maɓalli a kan <a>
da <button>
abubuwa, <button>
abubuwa ne kawai ake tallafawa a cikin abubuwan haɗin nav da navbar ɗin mu.
Idan <a>
ana amfani da abubuwan don yin aiki azaman maɓalli - yana haifar da ayyuka na cikin shafi, maimakon kewaya zuwa wani takarda ko sashe a cikin shafin na yanzu - ya kamata kuma a ba su abin da ya dace role="button"
.
A matsayin mafi kyawun aiki, muna ba da shawarar yin amfani da <button>
kashi a duk lokacin da zai yiwu don tabbatar da madaidaicin ma'anar mai binciken giciye.
Daga cikin wasu abubuwa, akwai kwaro a cikin Firefox <30 wanda ke hana mu saita maɓallai line-height
na <input>
tushen, yana sa ba su dace daidai da tsayin sauran maɓallan akan Firefox ba.
Yi amfani da kowane ɗayan darussan maɓalli don ƙirƙirar maɓalli mai salo da sauri.
Yin amfani da launi don ƙara ma'ana ga maɓalli kawai yana ba da alamar gani, wanda ba za a isar da shi ga masu amfani da fasahar taimako ba - kamar masu karanta allo. Tabbatar cewa bayanin da launi ke nunawa ko dai a bayyane yake daga abun cikin kanta (rubutun da ake gani na maɓalli), ko kuma an haɗa shi ta hanyar madadin, kamar ƙarin rubutu da ke ɓoye tare da .sr-only
ajin.
Kuna son manyan maɓalli ko ƙarami? Ƙara .btn-lg
, .btn-sm
, ko .btn-xs
don ƙarin girma.
Ƙirƙirar maɓallan matakin toshe-waɗanda ke faɗin faɗin mahaifa- ta ƙara .btn-block
.
Maɓallai za su bayyana a danna (tare da bango mai duhu, iyakar duhu, da inuwar saiti) lokacin aiki. Don <button>
abubuwa, ana yin wannan ta hanyar :active
. Don <a>
abubuwa, an yi shi da .active
. Koyaya, zaku iya amfani .active
da <button>
s (kuma ku haɗa da aria-pressed="true"
sifa) idan kuna buƙatar kwafin yanayin aiki da tsari.
Ba buƙatar ƙarawa :active
ba kamar yadda yake ajin ƙididdiga, amma idan kuna buƙatar tilasta bayyanar iri ɗaya, ci gaba da ƙara .active
.
Ƙara .active
ajin zuwa <a>
maɓalli.
Sanya maɓallan su yi kama da ba za a danna su ta hanyar mayar da su tare da opacity
.
Ƙara disabled
sifa zuwa <button>
maɓalli.
Idan ka ƙara disabled
sifa zuwa <button>
, Internet Explorer 9 da ƙasa za su sanya rubutu launin toka tare da inuwar rubutu mara kyau wanda ba za mu iya gyarawa ba.
Ƙara .disabled
ajin zuwa <a>
maɓalli.
Muna amfani .disabled
da ajin mai amfani anan, kama da na gama gari .active
, don haka ba a buƙatar prefix.
Wannan ajin yana amfani pointer-events: none
da shi don ƙoƙarin kashe ayyukan haɗin yanar gizo na <a>
s, amma wannan kayan CSS ba a daidaita ba tukuna kuma ba a samun cikakken tallafi a cikin Opera 18 da ƙasa, ko a cikin Internet Explorer 11. Bugu da ƙari, har ma a cikin masu binciken da ke goyan bayan pointer-events: none
, keyboard kewayawa ya kasance ba shi da tasiri, ma'ana cewa masu amfani da madannai masu gani da masu amfani da fasahar taimako har yanzu za su iya kunna waɗannan hanyoyin haɗin. Don haka don zama lafiya, yi amfani da JavaScript na al'ada don kashe irin waɗannan hanyoyin haɗin.
Hotuna a cikin Bootstrap 3 za a iya sanya su cikin jin daɗi ta hanyar ƙari na .img-responsive
ajin. Wannan ya shafi max-width: 100%;
, height: auto;
kuma display: block;
ga hoton domin ya daidaita da kyau zuwa kashi na iyaye.
Don tsakiyar hotuna masu amfani da .img-responsive
ajin, yi amfani da .center-block
maimakon .text-center
. Duba sashin azuzuwan taimako don ƙarin cikakkun bayanai game da .center-block
amfani.
A cikin Internet Explorer 8-10, hotunan SVG tare .img-responsive
da girman su ba su da yawa. Don gyara wannan, ƙara width: 100% \9;
inda ya cancanta. Bootstrap baya amfani da wannan ta atomatik saboda yana haifar da rikitarwa zuwa wasu tsarin hoto.
Ƙara azuzuwan zuwa <img>
kashi don sauƙin salo a kowane aiki.
Ka tuna cewa Internet Explorer 8 ba shi da tallafi don sasanninta.
Isar da ma'ana ta launi tare da ɗimbin girmamawa azuzuwan amfani. Ana iya amfani da waɗannan zuwa hanyoyin haɗin gwiwa kuma za su yi duhu a kan shawagi kamar yadda tsarin haɗin yanar gizon mu na asali.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Ka yi la'akari da abin da ake kira euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Wani lokaci ba za a iya amfani da azuzuwan girmamawa ba saboda keɓancewar wani zaɓi. A mafi yawan lokuta, isasshiyar mafita ita ce kunsa rubutun ku <span>
tare da aji.
Yin amfani da launi don ƙara ma'ana kawai yana ba da alamar gani, wanda ba za a isar da shi ga masu amfani da fasahar taimako ba - kamar masu karanta allo. Tabbatar cewa bayanin da launi ke nunawa ko dai a bayyane yake daga abubuwan da ke cikin kanta (ana amfani da launukan mahallin kawai don ƙarfafa ma'anar da ta riga ta kasance a cikin rubutu/tambarin), ko kuma an haɗa ta ta hanyar madadin, kamar ƙarin rubutu da ke ɓoye tare da .sr-only
ajin. .
Mai kama da azuzuwan launi na mahallin, a sauƙaƙe saita bangon wani abu zuwa kowane aji na mahallin. Abubuwan anka za su yi duhu akan shawagi, kamar azuzuwan rubutu.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Ka yi la'akari da abin da ake kira euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Wasu lokuta ba za a iya amfani da azuzuwan bayanan mahallin ba saboda keɓancewar wani zaɓi. A wasu lokuta, isasshiyar mafita ita ce haɗa abun cikin ku a <div>
cikin aji.
Kamar yadda yake tare da launuka na mahallin , tabbatar da cewa duk wata ma'anar da aka fitar ta hanyar launi kuma ana isar da ita a cikin sigar da ba ta gabatarwa kawai ba.
Yi amfani da madaidaicin gunkin kusa don korar abun ciki kamar tsari da faɗakarwa.
Yi amfani da kulawa don nuna ayyukan zazzagewa da jagora. Lura cewa tsohuwar kulawa za ta juya ta atomatik a menus da aka sauke .
Tashi wani kashi zuwa hagu ko dama tare da aji. !important
an haɗa shi don guje wa takamaiman batutuwa. Hakanan za'a iya amfani da azuzuwan azaman mixins.
Saita wani kashi zuwa display: block
da tsakiya ta margin
. Akwai shi azaman mixin da aji.
Sauƙaƙe float
s ta ƙara .clearfix
zuwa kashi na iyaye . Yana amfani da ƙaramin share fage kamar yadda Nicolas Gallagher ya shahara. Hakanan za'a iya amfani dashi azaman mixin.
Tilasta wani kashi don nunawa ko ɓoye ( ciki har da masu karanta allo ) tare da amfani .show
da .hidden
azuzuwan. Waɗannan azuzuwan suna amfani !important
da su don guje wa ƙayyadaddun rikice-rikice, kamar masu yawo da sauri . Suna samuwa kawai don jujjuya matakin toshe. Hakanan za'a iya amfani da su azaman mixins.
.hide
yana samuwa, amma ba koyaushe yana shafar masu karanta allo ba kuma yana ƙarewa har zuwa v3.0.1. Yi amfani .hidden
ko .sr-only
a maimakon haka.
Bugu da ƙari, .invisible
ana iya amfani da shi don kunna ganuwa kawai na wani abu, ma'ana display
ba a gyaggyara sa ba kuma ɓangaren na iya yin tasiri ga tafiyar daftarin aiki.
Boye wani abu ga duk na'urori ban da masu karanta allo tare da .sr-only
. Haɗa .sr-only
tare da .sr-only-focusable
sake nuna kashi lokacin da aka mayar da hankali (misali ta mai amfani da madannai kawai). Wajibi ne don bin mafi kyawun ayyuka . Hakanan za'a iya amfani dashi azaman mixins.
Yi amfani da .text-hide
ajin ko mahaɗa don taimakawa maye gurbin abun ciki na rubutu tare da hoton bango.
Don saurin haɓaka abokantaka na wayar hannu, yi amfani da waɗannan azuzuwan masu amfani don nunawa da ɓoye abun ciki ta na'urar ta hanyar tambayar kafofin watsa labarai. Hakanan an haɗa da azuzuwan masu amfani don juya abun ciki lokacin buga.
Yi ƙoƙarin amfani da waɗannan akan ƙayyadaddun tushe kuma guje wa ƙirƙirar nau'ikan rukunin yanar gizo daban-daban. Madadin haka, yi amfani da su don dacewa da gabatarwar kowace na'ura.
Yi amfani da guda ɗaya ko haɗe-haɗe na azuzuwan da ke akwai don jujjuya abun ciki a cikin wuraren faɗuwar kallo.
Ƙarin ƙananan na'uroriWayoyi (<768px) | Ƙananan na'uroriAllunan (≥768px) | Na'urori masu matsakaiciKwamfuta (≥992px) | Manyan na'uroriKwamfuta (≥1200px) | |
---|---|---|---|---|
.visible-xs-* |
Ganuwa | Boye | Boye | Boye |
.visible-sm-* |
Boye | Ganuwa | Boye | Boye |
.visible-md-* |
Boye | Boye | Ganuwa | Boye |
.visible-lg-* |
Boye | Boye | Boye | Ganuwa |
.hidden-xs |
Boye | Ganuwa | Ganuwa | Ganuwa |
.hidden-sm |
Ganuwa | Boye | Ganuwa | Ganuwa |
.hidden-md |
Ganuwa | Ganuwa | Boye | Ganuwa |
.hidden-lg |
Ganuwa | Ganuwa | Ganuwa | Boye |
Dangane da v3.2.0, .visible-*-*
azuzuwan kowane wurin hutu sun zo cikin bambance-bambancen guda uku, ɗaya don kowane display
ƙimar kadarorin CSS da aka jera a ƙasa.
Ƙungiyar azuzuwan | CSSdisplay |
---|---|
.visible-*-block |
display: block; |
.visible-*-inline |
display: inline; |
.visible-*-inline-block |
display: inline-block; |
Don haka, don ƙarin ƙananan xs
fuska ( ) misali, .visible-*-*
azuzuwan da ake da su sune: .visible-xs-block
, .visible-xs-inline
, da .visible-xs-inline-block
.
Azuzuwan .visible-xs
, .visible-sm
, .visible-md
, da .visible-lg
kuma wanzuwa, amma sun ƙare har zuwa v3.2.0 . Sun yi kusan daidai da .visible-*-block
, sai dai tare da ƙarin lokuta na musamman don <table>
abubuwan da ke da alaƙa.
Kama da azuzuwan amsa na yau da kullun, yi amfani da waɗannan don jujjuya abun ciki don bugawa.
Darasi | Browser | Buga |
---|---|---|
.visible-print-block .visible-print-inline .visible-print-inline-block |
Boye | Ganuwa |
.hidden-print |
Ganuwa | Boye |
Hakanan ajin .visible-print
yana wanzu amma an soke shi har zuwa v3.2.0 . Yana da kusan daidai da .visible-print-block
, sai dai tare da ƙarin lokuta na musamman don <table>
abubuwan da ke da alaƙa.
Maimaita girman burauzar ku ko lodi akan na'urori daban-daban don gwada azuzuwan masu amfani.
Alamun kore kore suna nuna ɓangaren yana bayyane a wurin kallon ku na yanzu.
Anan, alamun koren kuma suna nuna ɓoyayyiyar ɓangaren a wurin kallon ku na yanzu.
Bootstrap's CSS an gina shi akan Ƙananan, mai aiwatarwa tare da ƙarin ayyuka kamar masu canji, mixins, da ayyuka don haɗa CSS. Waɗanda ke neman amfani da tushen Fayiloli kaɗan maimakon fayilolin CSS ɗinmu da aka haɗe suna iya yin amfani da yawancin masu canji da mahaɗan da muke amfani da su a cikin tsarin.
Ana rufe masu canjin grid da mixins a cikin sashin tsarin Grid .
Ana iya amfani da Bootstrap aƙalla hanyoyi biyu: tare da haɗakarwar CSS ko tare da tushen Ƙananan fayiloli. Don tattara Ƙananan fayiloli, tuntuɓi sashin Farawa don yadda ake saita yanayin ci gaban ku don gudanar da mahimman umarni.
Kayan aikin haɗin ɓangare na uku na iya aiki tare da Bootstrap, amma ƙungiyar mu ba ta da goyan bayan su.
Ana amfani da sauye-sauye a cikin gabaɗayan aikin a matsayin hanya don daidaitawa da raba dabi'un da aka saba amfani da su kamar launuka, tazara, ko tarin rubutu. Don cikakken ɓarna, da fatan za a duba Customizer .
Sauƙaƙe yin amfani da tsarin launi guda biyu: launin toka da na ma'ana. Launuka masu launin toka suna ba da dama ga sauri zuwa inuwar baƙar fata da aka saba amfani da su yayin da na fassara ya haɗa da launuka daban-daban waɗanda aka ba da ƙima masu ma'ana.
Yi amfani da kowane ɗayan waɗannan masu canjin launi kamar yadda suke ko sake sanya su zuwa mafi ma'ana masu ma'ana don aikinku.
Kadan daga cikin masu canji don daidaita mahimman abubuwan kwarangwal ɗin rukunin yanar gizonku da sauri.
Sauƙaƙa salon hanyoyin haɗin yanar gizon ku tare da madaidaicin launi tare da ƙima ɗaya kawai.
Lura cewa @link-hover-color
yana amfani da aiki, wani kayan aiki mai ban sha'awa daga Ƙananan, don ƙirƙirar launi mai dacewa ta atomatik. Kuna iya amfani da darken
, lighten
, saturate
, da desaturate
.
Sauƙaƙe saita nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'in nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i nau'i) nau'i-nau'i. Bootstrap yana yin amfani da waɗannan kuma don samar da mahaɗin rubutu cikin sauƙi.
Sau biyu masu saurin canji don keɓance wuri da sunan fayil na gumakanku.
Abubuwan da ke cikin Bootstrap suna amfani da wasu tsoho masu canji don saita ƙima na gama gari. Anan ne aka fi amfani da su.
Mixins masu siyarwa sune mixins don taimakawa tallafawa masu bincike da yawa ta haɗa da duk prefixes masu siyarwa masu dacewa a cikin CSS ɗin ku.
Sake saita samfurin akwatin kayan aikin ku tare da mahaɗa guda ɗaya. Don mahallin, duba wannan labarin mai taimako daga Mozilla .
An soke mixin kamar na v3.2.0 , tare da gabatarwar Autoprefixer. Don adana jituwa-baya, Bootstrap zai ci gaba da amfani da mahaɗin a ciki har sai Bootstrap v4.
A yau duk masu bincike na zamani suna goyan bayan border-radius
kadarorin da ba a sa gaba ba. Don haka, babu .border-radius()
mixin, amma Bootstrap ya haɗa da gajerun hanyoyi don saurin zagaye sasanninta biyu a wani gefen abu.
Idan masu sauraron ku suna amfani da sababbin kuma mafi girma masu bincike da na'urori, tabbatar da yin amfani da box-shadow
dukiyar da kanta. Idan kuna buƙatar tallafi don tsofaffin na'urorin Android (pre-v4) da na'urorin iOS (pre-iOS 5), yi amfani da mahaɗin da aka yanke don ɗaukar -webkit
prefix ɗin da ake buƙata.
An soke mixin kamar na v3.1.0, tun da Bootstrap baya goyan bayan tsofaffin dandamali waɗanda ba sa goyan bayan daidaitaccen kadarorin. Don adana jituwa-baya, Bootstrap zai ci gaba da amfani da mahaɗin a ciki har sai Bootstrap v4.
Tabbatar yin amfani da rgba()
launuka a cikin inuwar akwatin ku don haka suna haɗuwa kamar yadda zai yiwu tare da bango.
Mixins masu yawa don sassauci. Saita duk bayanan canji tare da guda ɗaya, ko ƙididdige ɗan lokaci da tsawon lokacin da ake buƙata.
An soke mixins kamar na v3.2.0, tare da gabatarwar Autoprefixer. Don adana jituwa-baya, Bootstrap zai ci gaba da amfani da mahaɗin ciki har sai Bootstrap v4.
Juyawa, sikeli, fassara (matsar da), ko karkatar da kowane abu.
An soke mixins kamar na v3.2.0, tare da gabatarwar Autoprefixer. Don adana jituwa-baya, Bootstrap zai ci gaba da amfani da mahaɗin ciki har sai Bootstrap v4.
Mixin guda ɗaya don amfani da duk kaddarorin rayarwa na CSS3 a cikin shela ɗaya da sauran haɗe-haɗe don kaddarorin mutum ɗaya.
An soke mixins kamar na v3.2.0, tare da gabatarwar Autoprefixer. Don adana jituwa-baya, Bootstrap zai ci gaba da amfani da mahaɗin ciki har sai Bootstrap v4.
Saita rashin sarari don duk masu bincike kuma samar da filter
koma baya ga IE8.
Samar da mahallin don sarrafa tsari a cikin kowane fage.
Ƙirƙirar ginshiƙai ta hanyar CSS a cikin kashi ɗaya.
Sauƙaƙe juya kowane launuka biyu zuwa bangon bango. Samun ci gaba da saita alkibla, yi amfani da launuka uku, ko amfani da radial gradient. Tare da mixin guda ɗaya za ku sami duk prefixed syntaxes da kuke buƙata.
Hakanan zaka iya ƙayyade kusurwar daidaitaccen launi biyu, gradient na layi:
Idan kana buƙatar salon gradient na aski, yana da sauƙi, kuma. Kawai saka launi guda ɗaya kuma za mu lulluɓe wani farin ratsin fari mai jujjuyawa.
Haɓaka ante kuma yi amfani da launuka uku maimakon. Saita launi na farko, launi na biyu, tsayawar launi na biyu (ƙimar kashi kamar 25%), da launi na uku tare da waɗannan mixins:
A kula! Idan kun taɓa buƙatar cire gradient, tabbatar da cire kowane takamaiman IE wanda filter
wataƙila kun ƙara. Kuna iya yin haka ta amfani da .reset-filter()
mixin tare da background-image: none;
.
Mixins masu amfani sune mixins waɗanda ke haɗa in ba haka ba kaddarorin CSS marasa alaƙa don cimma takamaiman manufa ko ɗawainiya.
Manta ƙara class="clearfix"
zuwa kowane kashi kuma a maimakon haka ƙara .clearfix()
mixin a inda ya dace. Yana amfani da micro clearfix daga Nicolas Gallagher .
Yi sauri tsakiya kowane bangare a cikin mahaifansa. Ana buƙatar width
ko max-width
saita.
Ƙayyade girman abu cikin sauƙi.
Sauƙaƙe daidaita zaɓuɓɓukan girman girman kowane yanki na rubutu, ko kowane abu. Matsaloli ga dabi'ar burauza ta al'ada ( both
).
Sauƙaƙe datse rubutu tare da ellipsis tare da mixin guda ɗaya. Yana buƙatar kashi ya zama block
ko inline-block
matakin.
Ƙayyade hanyoyin hoto guda biyu da girman hoton @1x, kuma Bootstrap zai samar da tambayar mai jarida @2x. Idan kuna da hotuna da yawa da za ku yi aiki, yi la'akari da rubuta CSS hoton retina da hannu a cikin tambayar kafofin watsa labarai guda ɗaya.
Yayin da aka gina Bootstrap akan Ƙananan, yana da tashar tashar Sass na hukuma . Muna kiyaye shi a cikin keɓan ma'ajiyar GitHub kuma muna ɗaukar sabuntawa tare da rubutun juyawa.
Tunda tashar tashar Sass tana da repo daban kuma tana hidimar masu sauraro daban-daban, abubuwan da ke cikin aikin sun bambanta sosai da babban aikin Bootstrap. Wannan yana tabbatar da tashar tashar Sass ta dace da yawancin tsarin tushen Sass gwargwadon yiwuwa.
Hanya | Bayani |
---|---|
lib/ |
Ruby gem code (Sass sanyi, Rails da Compass hadewa) |
tasks/ |
Rubutun masu juyawa (juyawa ƙasa ƙasa zuwa Sass) |
test/ |
Gwaje-gwajen tattarawa |
templates/ |
Bayyanar fakitin Compass |
vendor/assets/ |
Sass, JavaScript, da fayilolin rubutu |
Rakefile |
Ayyuka na ciki, kamar rake da juyawa |
Ziyarci ma'ajin GitHub na tashar tashar Sass don ganin waɗannan fayilolin suna aiki.
Don bayani kan yadda ake shigarwa da amfani da Bootstrap don Sass, tuntuɓi GitHub readme . Ita ce mafi sabuntar tushen kuma ya haɗa da bayanai don amfani tare da Rails, Compass, da daidaitattun ayyukan Sass.