Ho fallela ho v4
Bootstrap 4 ke mongolo o moholo oa morero oohle. Liphetoho tse hlokomelehang ka ho fetesisa li akaretsoa ka tlase, 'me li lateloe ke liphetoho tse tobileng ho likarolo tse amehang.
Ho tloha ho Beta 3 ho ea ho tokollo ea rona ea v4.0 e tsitsitseng, ha ho na liphetoho tse robehileng, empa ho na le liphetoho tse hlokomelehang.
-
Lisebelisoa tse tsitsitseng tsa khatiso tse robehileng. Pele, ho sebelisa
.d-print-*
sehlopha ho ne ho tla senya sehlopha sefe kapa sefe ka tšohanyetso.d-*
. Hona joale, li tsamaisana le lisebelisoa tse ling tsa rona tsa pontšo 'me li sebetsa feela ho mecha ea phatlalatso (@media print
). -
E atolositse lisebelisoa tse fumanehang tsa khatiso ho tsamaisana le lisebelisoa tse ling. Beta 3 le ho feta ba ne ba na le
block
,inline-block
,inline
, lenone
. V4 e tsitsitseng e ekelitsoeflex
,inline-flex
,table
,table-row
, letable-cell
. -
Ponahalo e sa fetoheng ea ho hatisa libatli kaofela ka mefuta e mecha ea khatiso e hlakisang
@page
size
.
Le ha Beta 2 e bone boholo ba liphetoho tsa rona tse robehileng nakong ea beta, empa re ntse re na le tse 'maloa tse hlokang ho rarolloa tokollong ea Beta 3. Liphetoho tsena li sebetsa haeba u ntse u ntlafatsa ho Beta 3 ho tsoa ho Beta 2 kapa mofuta ofe kapa ofe oa khale oa Bootstrap.
- E tlositse mofuta o sa sebelisoeng
$thumbnail-transition
. Re ne re sa fetole letho, kahoo e ne e le khoutu e eketsehileng feela. - Sephutheloana sa npm ha se sa kenyelletsa lifaele tse ling ntle le mohloli oa rona le lifaele tsa dist; haeba u ne u itšetlehile ka tsona 'me u ntse u sebelisa mangolo a rona ka
node_modules
foldara, u lokela ho fetola mokhoa oa hau oa ho sebetsa.
-
Ngola hape li-checkbox le liea-le-moea tse tloaelehileng. Hona joale, ka bobeli ba na le sebopeho sa HTML se ts'oanang (ka ntle
<div>
le ngoan'eno<input>
le<label>
) le mekhoa e tšoanang ea sebopeho (e behiloeng ka mokhoa o sa feleng, e lumellanang le sehlopha sa modifier). Sena se re fa monyetla oa ho etsa setaele ho latela boemo ba tlhahiso, ho nolofatsa ts'ehetso bakeng sadisabled
tšobotsi (eo pele e neng e hloka sehlopha sa batsoali) le ho ts'ehetsa hamolemo netefatso ea foromo.E le karolo ea sena, re fetotse CSS bakeng sa ho laola li-multiple
background-image
s ho li-boxbox tsa liforomo tse tloaelehileng le liea-le-moea. Pejana,.custom-control-indicator
ntho e neng e se e tlositsoe e ne e na le 'mala oa bokamorao, gradient le letšoao la SVG. Ho ikamahanya le maemo a ka morao ho ne ho bolela ho khutlisa tseo kaofela nako le nako ha u ne u hloka ho fetola e le 'ngoe. Hona joale, re na.custom-control-label::before
le ho tlatsa le gradient le ho.custom-control-label::after
sebetsana le aekhone.Ho etsa tlhahlobo e ikhethileng ka har'a marang-rang, eketsa
.custom-control-inline
. -
Sekhetho se ntlafalitsoeng bakeng sa lihlopha tse thehiloeng ho likonopo. Sebakeng
[data-toggle="buttons"] { }
sa setaele le boits'oaro, re sebelisadata
tšobotsi feela bakeng sa boits'oaro ba JS mme re itšetleha ka sehlopha se secha.btn-group-toggle
bakeng sa setaele. -
E tlositsoe
.col-form-legend
molemong oa ntlafatso e nyane.col-form-label
. Ka tsela ena.col-form-label-sm
'me.col-form-label-lg
e ka sebelisoa ho<legend>
likarolo ka bonolo. -
Litlhahiso tsa faele tse tloahelehileng li fumane phetoho ho mofuta oa bona oa
$custom-file-text
Sass. Ha e sa le 'mapa oa Sass o behiloeng sehlaheng,' me joale o na le khoele e le 'ngoe feela -Browse
konopo kaha ke eona feela ntho ea pseudo e hlahisoang ke Sass ea rona. MongoloChoose file
joale o tsoa ho.custom-file-label
.
-
Li-addons tsa lihlopha tsa li-input li se li totobalitse ho beoa ha tsona ho ipapisitse le kenyeletso. Re theohile
.input-group-addon
'me.input-group-btn
bakeng sa lihlopha tse peli tse ncha,.input-group-prepend
le.input-group-append
. O tlameha ho sebelisa sehlomathiso ka ho hlaka kapa ho etsa esale pele hona joale, o nolofatsa boholo ba CSS ea rona. Ka har'a append kapa prepend, beha likonopo tsa hau kamoo li neng li tla ba teng kae kapa kae, empa thatela mongolo ka.input-group-text
. -
Mekhoa ea ho netefatsa e se e tšehetsoa, joalo ka lintho tse kenyellelitsoeng tse ngata (leha u ka netefatsa kenyeletso e le 'ngoe feela sehlopheng ka seng).
-
Litlelase tsa boholo li tlameha ho ba ho motsoali
.input-group
eseng likarolo tsa sebopeho sa motho ka mong.
Ha re ntse re le beta, re ikemiselitse ho se be le liphetoho tse robehileng. Leha ho le joalo, lintho ha li tsamaee kamoo ho neng ho reriloe kateng. Ka tlase ke liphetoho tse bohlokoa tseo u lokelang ho li hopola ha u tloha Beta 1 ho ea ho Beta 2.
- E tlositsoe
$badge-color
ho feto-fetoha le tšebeliso ea eona ho.badge
. Re sebelisa tšebetso ea ho bapisa mebala ho khetha ecolor
ipapisitseng lebackground-color
, kahoo ho feto-fetoha ha ho hlokahale. grayscale()
Mosebetsi o rehelletsoenggray()
ho qoba ho senya khohlano le sefe ea tlhaho sa CSSgrayscale
.- E reheletsoe bocha
.table-inverse
,.thead-inverse
, le.thead-default
ho.*-dark
le.*-light
, tse tsamaellanang le merero ea rona ea mebala e sebelisoang libakeng tse ling. - Litafole tse arabelang joale li hlahisa lihlopha bakeng sa sebaka se seng le se seng sa marang-rang. Sena se tloha ho Beta 1 ka hore
.table-responsive
eo esale u e sebelisa e tšoana le.table-responsive-md
. Joale o ka sebelisa.table-responsive
kapa.table-responsive-{sm,md,lg,xl}
ha ho hlokahala. - Ts'ehetso ea Bower e theohileng kaha molaoli oa sephutheloana o tlositsoe bakeng sa mekhoa e meng (mohlala, Yarn kapa npm). Sheba bower/bower#2298 bakeng sa lintlha.
- Bootstrap e ntse e hloka jQuery 1.9.1 kapa ho feta, empa u eletsoa ho sebelisa mofuta oa 3.x kaha li-browser tse tšehetsoeng ke v3.x ke tsona tse tšehetsoang ke Bootstrap hammoho le v3.x e na le litokiso tse ling tsa ts'ireletso.
- E tlositse sehlopha se sa sebelisoeng
.form-control-label
. Haeba u kile ua sebelisa sehlopha sena, e ne e le sekoaelo sa.col-form-label
sehlopha se tsepamisitseng bohareng ba<label>
sona se amanang le lipeakanyo tsa libopeho tse tšekaletseng. - E fetotse ho
color-yiq
tloha ho motsoako o kenyelletsangcolor
thepa ho ts'ebetso e khutlisetsang boleng, e u lumellang ho e sebelisa bakeng sa thepa efe kapa efe ea CSS. Ka mohlala, sebakeng sacolor-yiq(#000)
, u tla ngolacolor: color-yiq(#000);
.
pointer-events
E hlahisitse tšebeliso e ncha ho li-modal. E ka ntle.modal-dialog
e feta har'a liketsahalo kapointer-events: none
mokhoa oa ho penya (ho etsa hore ho khonehe ho mamela feela.modal-backdrop
bakeng sa ho tobetsa leha e le efe), ebe e hanyetsana le ea sebele.modal-content
kapointer-events: auto
.
Mona ke lintho tse kholo tsa litekete tseo u tla batla ho li ela hloko ha u tloha v3 ho ea ho v4.
- E theohile tšehetso ea IE8, IE9, le iOS 6. v4 hona joale ke IE10+ feela le iOS 7+. Bakeng sa libaka tse hlokang e 'ngoe ea tsona, sebelisa v3.
- E kentse tšehetso ea semmuso bakeng sa Android v5.0 Lollipop's Browser le WebView. Liphetolelo tsa pejana tsa Sebatli sa Android le WebView li lula li tšehetsoa ka mokhoa o seng molaong.
- Flexbox e nolofalitsoe ke kamehla. Ka kakaretso sena se bolela ho suthela hole le ho phaphamala le ho feta ho pholletsa le likarolo tsa rona.
- Fetohile ho tloha ho Less ho ea ho Sass bakeng sa mohloli oa lifaele tsa CSS tsa rona.
- E fetotsoe ho tloha
px
ho ea horem
yuniti ea rona ea mantlha ea CSS, leha lipikselse li ntse li sebelisoa bakeng sa lipotso tsa media le boits'oaro ba marang-rang kaha liemahale tsa lisebelisoa ha li amehe ke boholo ba mofuta. - Bophahamo ba fonte bo eketsehile ho tloha
14px
ho16px
. - Li-grid tse ntlafalitsoeng ho kenyelletsa khetho ea bohlano (ho sebetsana le lisebelisoa tse nyane ka
576px
tlase le ka tlase) le ho tlosa-xs
infix lihlopheng tseo. Mohlala.col-6.col-sm-4.col-md-3
:. - E fetoletse sehlooho se ikhethileng ka likhetho tse ka lokisoang ka mefuta ea SCSS (mohlala,
$enable-gradients: true
). - Haha sistimi e fetotsoeng ho sebelisa letoto la lingoloa tsa npm sebakeng sa Grunt. Sheba
package.json
bakeng sa mangolo ohle, kapa projeke ea rona e balle litlhoko tsa ntlafatso ea lehae. - Tšebeliso e sa arabeleng ea Bootstrap ha e sa tšehetsoa.
- E lahlile Customizer ea inthaneteng molemong oa litokomane tse pharalletseng tsa ho seta le meaho e ikhethileng.
- E kentse litlelase tse ngata tse ncha tsa lisebelisoa bakeng sa lipara tse tloaelehileng tsa boleng ba thepa ea CSS le likhutšoane tsa sebaka sa marang-rang / padding.
- E fetiselitsoe ho flexbox.
- Ts'ehetso e ekelitsoeng bakeng sa flexbox ho li-mixins tsa grid le litlelase tse boletsoeng esale pele.
- E le karolo ea flexbox, e kenyelelitsoe tšehetso bakeng sa lihlopha tse otlolohileng le tse tšekaletseng.
- Mabitso a sehlopha sa grid a ntlafalitsoeng le tier e ncha ea grid.
- E kentse karolo e ncha
sm
ea grid ka tlase768px
bakeng sa taolo e eketsehileng ea granular. Hona joale re na lexs
,sm
,md
,lg
, lexl
. Sena se boetse se bolela hore boemo bo bong le bo bong bo phahamisitsoe boemong bo le bong (ka hona.col-md-6
ho v3 e se.col-lg-6
e le v4). xs
litlelase tsa grid li fetotsoe hore li se ke tsa hloka infix ho bontša ka nepo haholoanyane hore ba qala ho sebelisa mekhoa emin-width: 0
seng boleng bo behiloeng ba pixel. Ho e-na le hoo.col-xs-6
, ke hona joale.col-6
. Li-tier tse ling tsohle tsa grid li hloka infix (mohlala,sm
).
- E kentse karolo e ncha
- Li-grid tsa boholo bo ntlafalitsoeng, metsoako le mefuta e fapaneng.
- Li-gutter tsa grid joale li na le 'mapa oa Sass kahoo o ka hlakisa bophara bo khethehileng sebakeng se seng le se seng.
- Metsoako e ntlafalitsoeng ea grid ho sebelisa motsoako oa
make-col-ready
prep le amake-col
ho behaflex
lemax-width
bakeng sa boholo ba kholomo ka bomong. - Liphetoho tse fetotsoeng tsa lipotso tsa media system le bophara ba setshelo ho ikarabella bakeng sa boemo bo bocha ba grid le ho netefatsa hore litšiea li aroloa ka
12
ho lekana ka bophara ba tsona bo boholo. - Li-breakpoint tsa grid le bophara ba setshelo li se li sebetsoa ka limmapa tsa Sass (
$grid-breakpoints
le$container-max-widths
) sebakeng sa mefuta e mengata e fapaneng. Tsena li nka sebaka sa@screen-*
mefuta-futa ka ho feletseng 'me li u lumella ho etsa li-tier tsa grid ka botlalo. - Lipotso tsa mecha ea litaba le tsona li fetohile. Sebakeng sa ho pheta-pheta liphatlalatso tsa lipotso tsa media ka boleng bo tšoanang nako le nako, joale re na le
@include media-breakpoint-up/down/only
. Hona joale, ho e-na le ho ngola@media (min-width: @screen-sm-min) { ... }
, u ka ngola@include media-breakpoint-up(sm) { ... }
.
- Liphanele tse theohileng, li-thumbnails, le liliba bakeng sa karolo e ncha e akaretsang, likarete .
- E lahlile fonte ea letšoao la Glyphicons. Haeba o hloka li-icon, likhetho tse ling ke tsena:
- mofuta o holimo oa Glyphicons
- Litlhare
- Font e Hlollang
- Sheba leqephe la Eketsa bakeng sa lethathamo la mekhoa e meng. O na le litlhahiso tse ling? Ka kopo, bula taba kapa PR.
- E lahlile plugin ea Affix jQuery.
- Re khothaletsa ho sebelisa
position: sticky
. Sheba HTML5 Ka kopo kena bakeng sa lintlha le likhothaletso tse khethehileng tsa polyfill. Tlhahiso e 'ngoe ke ho sebelisa@supports
molao bakeng sa ho e sebelisa (mohlala,@supports (position: sticky) { ... }
)/ - Haeba u ne u sebelisa Affix ho sebelisa mefuta e meng, e seng
position
ea mefuta, li-polyfill li kanna tsa se ke tsa tšehetsa nyeoe ea hau ea ts'ebeliso. Khetho e le 'ngoe bakeng sa ts'ebeliso e joalo ke laeborari ea mokha oa boraro ea ScrollPos-Styler .
- Re khothaletsa ho sebelisa
- E lahlile karolo ea pager kaha e ne e le likonopo tse ikhethileng hanyane.
- E ntlafalitse hoo e batlang e le likarolo tsohle ho sebelisa likhetho tse ngata tsa lihlopha tse se nang lihlaha ho e-na le likhetho tsa bana tse khethehileng haholo.
Lenane lena le totobatsa liphetoho tsa bohlokoa ka karolo lipakeng tsa v3.xx le v4.0.0.
E ncha ho Bootstrap 4 ke Reboot , leqephe le lecha la setaele le hahang holim'a Normalize ka mekhoa ea rona e nang le maikutlo a itseng. Bakhethi ba hlahang faeleng ena ba sebelisa likaroloana feela - ha ho na lihlopha mona. Sena se arola mekhoa ea rona ea ho seta bocha ho tsoa mefuteng ea likarolo tsa rona bakeng sa mokhoa o tloaelehileng haholoanyane. Tse ling tsa li-reset tsa bohlokoa ka ho fetisisa tse kenyeletsang ke box-sizing: border-box
phetoho, ho tloha em
ho ea ho rem
li-unit ho li-element tse ngata, mekhoa ea lihokelo, le li-resets tsa mefuta e mengata.
- E tsamaisitse lisebelisoa tsohle
.text-
ho_utilities.scss
file. - E theotsoe
.page-header
joalo ka, ntle le moeli, mefuta eohle ea eona e ka sebelisoa ka lisebelisoa. .dl-horizontal
e theotsoe. Sebakeng seo, sebelisa le.row
ho<dl>
sebelisa lihlopha tsa kholomo ea grid (kapa li-mixins) ho eona<dt>
le<dd>
bana.- Setaele se tloahelehileng
<blockquote>
se falletse litlelaseng -.blockquote
le mofetoleli.blockquote-reverse
. .list-inline
hona joale e hloka hore bana ba eona ba lethathamo la lintho ba be le sehlopha se secha.list-inline-item
se sebelisitsoeng ho bona.
- E reheletsoe bocha
.img-responsive
ho.img-fluid
. - E reheletsoe bocha
.img-rounded
ho.rounded
- E reheletsoe bocha
.img-circle
ho.rounded-circle
- Hoo e ka bang maemo ohle a
>
mokhethoa a tlositsoe, ho bolelang hore litafole tse behiloeng sehlaheng joale li tla rua mekhoa ho tsoa ho batsoali ba bona. Sena se nolofatsa batho ba re khethang haholo le tseo re ka li khethang. - Litafole tse arabelang ha li sa hloka ntho e phuthelang. Ho e-na le hoo, beha feela se
.table-responsive
nepahetseng ho<table>
. - E reheletsoe bocha
.table-condensed
bakeng.table-sm
sa tumellano. - E kentse khetho e ncha
.table-inverse
. - Liphetoho tsa lihlooho tsa tafole tse ekelitsoeng:
.thead-default
le.thead-inverse
. - E reha mabitso a litlelase tsa maemo ho ba le
.table-
-prefix. Kahoo.active
,.success
,.warning
,.danger
le.info
ho.table-active
,.table-success
, le ..table-warning
_.table-danger
.table-info
- E tsamaisitsoe ho seta botjha
_reboot.scss
faeleng. - E reheletsoe bocha
.control-label
ho.col-form-label
. - E reheletsoe bocha
.input-lg
le.input-sm
ho.form-control-lg
le ho.form-control-sm
, ka ho latellana. - Litlelase tse theohileng
.form-group-*
molemong oa ho nolofatsa. Sebelisa.form-control-*
litlelase hona joale. - E theohile
.help-block
'me ea e nkela sebaka.form-text
bakeng sa mongolo oa thuso oa boemo ba block. Bakeng sa mongolo oa thuso oa inline le likhetho tse ling tse feto-fetohang, sebelisa litlelase tsa utility joalo ka.text-muted
. - E theohile
.radio-inline
le.checkbox-inline
. - E kopantsoe
.checkbox
le.radio
ho kena.form-check
le lihlopha tse fapaneng.form-check-*
. - Mefuta e otlolohileng e fetotsoe:
- E lahlile
.form-horizontal
tlhoko ea sehlopha. .form-group
ha e sa sebetsa mekhoa e tsoang ho.row
mixin, kahoo.row
e se e hlokahala bakeng sa meralo ea grid e otlolohileng (mohlala,<div class="form-group row">
).- E kentse sehlopha se secha
.col-form-label
ho li-labels tse theohileng bohareng tse nang le.form-control
s. - E kenyellelitsoe tse ncha
.form-row
bakeng sa meralo ea li-compact form ka lihlopha tsa grid (fapanyetsana.row
bakeng sa a.form-row
le ho tsamaea).
- E lahlile
- Ts'ehetso ea liforomo tse kentsoeng (bakeng sa li-checkbox, li-radio, likhetho, le lintho tse kentsoeng lifaeleng).
- E nchafalitsoe
.has-error
,.has-warning
, le.has-success
litlelase tse nang le netefatso ea liforomo tsa HTML5 ka litlelase tsa CSS:invalid
le tsa:valid
pseudo. - E reheletsoe bocha
.form-control-static
ho.form-control-plaintext
.
- E reheletsoe bocha
.btn-default
ho.btn-secondary
. - E theohile
.btn-xs
sehlopheng ka ho felletseng kaha.btn-sm
e nyane haholo ho feta ea v3. - Karolo e hlakileng ea konopo ea
button.js
jQuery plugin e lahliloe. Sena se kenyelletsa mekhoa$().button(string)
le$().button('reset')
mekhoa. Re eletsa ho sebelisa JavaScript e tloaelehileng ho e-na le hoo, e tla ba le molemo oa ho itšoara ka tsela eo u batlang hore e be ka eona.- Hlokomela hore likarolo tse ling tsa plugin (likonopo tsa li-checkbox, li-radio tsa konopo, likonopo tsa toggle e le 'ngoe) li bolokiloe ho v4.
- Fetola likonopo'
[disabled]
ho ea:disabled
kamoo IE9+ e tšehetsang:disabled
. Leha ho le joalofieldset[disabled]
ho ntse ho hlokahala hobane masimo a batho ba nang le bokooa a ntse a le teng ho IE11 .
- Ngola karolo hape ka flexbox.
- E tlositsoe
.btn-group-justified
. E le sebaka sa sebaka seo u ka se sebelisang<div class="btn-group d-flex" role="group"></div>
e le sekoahelo se pota-potileng likarolo tse nang le.w-100
. - E ile ea theola
.btn-group-xs
sehlopha ka ho feletseng ka ho tlosoa ha.btn-xs
. - E tlositse sebaka se hlakileng pakeng tsa lihlopha tsa likonopo ka har'a li-toolbar tsa likonopo; sebelisa lisebelisoa tsa marang-rang hona joale.
- Litokomane tse ntlafalitsoeng bakeng sa ho sebelisoa le likarolo tse ling.
- Fetohile ho tloha ho bakhethoa ba batsoali ho ea ho lihlopha tse bonngoeng bakeng sa likarolo tsohle, li-modifiers, joalo-joalo.
- Mekhoa e nolofalitsoeng ea ho theoha hore e se hlole e romelloa ka metsu e shebileng holimo kapa tlase e kenyellelitsoeng lethathamong la litheolelo.
- Dropdowns e ka hahoa ka
<div>
s kapa<ul>
s hona joale. - Aha bocha setaele le li-markup ho fana ka tšehetso e bonolo, e hahelletsoeng kahare bakeng sa
<a>
lintho<button>
tse theohang. - E reheletsoe bocha
.divider
ho.dropdown-divider
. - Lintho tse theolelang hona joale lia hlokahala
.dropdown-item
. - Li-toggles tse theohang ha li sa hloka ho hlakisa
<span class="caret"></span>
; hona joale ho fanoa ka boiketsetso ka CSS's::after
ho.dropdown-toggle
.
- E kentse sebaka se secha
576px
sa marang-rang joalo kasm
, ho bolelang hore joale ho na le mekhahlelo e mehlano (xs
,sm
,md
,lg
, lexl
). - E reha mabitso a litlelase tse arabelang tsa grid ho tloha ho ea
.col-{breakpoint}-{modifier}-{size}
ho.{modifier}-{breakpoint}-{size}
bakeng sa litlelase tse bonolo tsa grid. - Ho theohile litlelase tsa ho sututsa le ho hula bakeng sa litlelase tse ncha tse tsamaisoang ke flexbox
order
. Ka mohlala, sebakeng sa.col-8.push-4
le.col-4.pull-8
, u tla sebelisa.col-8.order-2
le.col-4.order-1
. - E kenyellelitsoe litlelase tsa tšebeliso ea flexbox bakeng sa sistimi ea grid le likarolo.
- Ngola karolo hape ka flexbox.
- E nkeloe sebaka
a.list-group-item
ke sehlopha se hlakileng,.list-group-item-action
, bakeng sa sehokelo sa setaele le mefuta ea likonopo tsa lintho tsa sehlopha. - Sehlopha se ekelitsoeng
.list-group-flush
bakeng sa ho sebelisoa le likarete.
- Ngola karolo hape ka flexbox.
- Ka lebaka la ho falla ho flexbox, ho lokisoa ha litšoantšo tse ka sehloohong ho ka 'na ha robeha kaha ha re sa sebelisa liphaphatha. Litaba tse phaphametseng li tla pele, empa ka flexbox ha ho sa le joalo. Ntlafatsa li-icon tsa hau tsa ho leleka hore li tle ka mor'a litlotla tsa modal ho li lokisa.
- Khetho
remote
(e ka sebelisoang ho kenya le ho kenya litaba tsa kantle ho modal) mmeloaded.bs.modal
ketsahalo e tsamaellanang e ile ea tlosoa. Re khothaletsa ho sebelisa template ea lehlakore la bareki kapa moralo o tlamang data, kapa ho letsetsa jQuery.load ka bouena.
- Ngola karolo hape ka flexbox.
- E lahlile hoo e batlang e le likhetho tsohle
>
bakeng sa setaele se bonolo ka litlelase tse se nang lihlaha. - Sebakeng sa bakhethoa ba khethehileng ba HTML joalo ka
.nav > li > a
, re sebelisa litlelase tse arohaneng bakeng sa.nav
s,.nav-item
s, le.nav-link
s. Sena se etsa hore HTML ea hau e be bonolo haholoanyane ha e ntse e tlisa katoloso e eketsehileng.
Navbar e ngotsoe bocha ka botlalo ka har'a flexbox ka ts'ehetso e ntlafalitsoeng bakeng sa ho tsamaisana, karabelo le ho itlhophisa.
- Boitšoaro bo arabelang ba navbar bo se bo sebelisoa
.navbar
sehlopheng ka tsela e hlokahalang.navbar-expand-{breakpoint}
moo u khethang moo u ka phunyang navbar. Pele, sena e ne e le phetoho e fokolang mme e hloka ho khutlisetsoa morao. .navbar-default
hona joale.navbar-light
, le hoja.navbar-dark
e ntse e le joalo. E 'ngoe ea tsena e ea hlokahala sebakeng se seng le se seng sa navbar. Leha ho le joalo, lihlopha tsena ha li sa behabackground-color
s; ho e-na le hoo li ama feelacolor
.- Li-Navbar joale li hloka phatlalatso ea morao-rao ea mofuta o itseng. Khetha ho tsoa ho lits'ebeletso tsa rona tsa morao-rao (
.bg-*
) kapa u ipehele ea hau ka litlelase tse bobebe/tse fapaneng tse kaholimo bakeng sa ho itloaetsa ka bohlanya . - Ka lebaka la mekhoa ea flexbox, li-navbar joale li ka sebelisa lisebelisoa tsa flexbox bakeng sa likhetho tse bonolo tsa ho tsamaisana.
.navbar-toggle
e se e le hona joale.navbar-toggler
'me e na le mekhoa e fapaneng le markup ea ka hare (ha e sa le<span>
s tse tharo).- E ile ea tlohela
.navbar-form
tlelase ka ho feletseng. Ha e sa hlokahala; ho e-na le hoo, sebelisa feela.form-inline
le ho sebelisa lisebelisoa tsa margin ha ho hlokahala. - Navbar ha e sa kenyelletsa
margin-bottom
kapaborder-radius
ka ho sa feleng. Sebelisa lisebelisoa ha ho hlokahala. - Mehlala eohle e nang le li-navbar e nchafalitsoe ho kenyelletsa li-markup tse ncha.
- Ngola karolo hape ka flexbox.
- Lihlopha tse hlakileng (
.page-item
,.page-link
) li se li hlokoa ho litloholo tsa.pagination
s - E lahlile
.pager
karolo ka botlalo kaha e ne e le li-buttons tse ikhethileng tsa kemiso.
- Sehlopha se hlakileng,
.breadcrumb-item
, se hlokahala joale ho litloholo tsa.breadcrumb
s
- E reheletsoe hape
.label
ho.badge
ho nyenyefatsa ho tsoa ho<label>
element. - E lahlile
.badge
karolo ena kaha e ne e batla e ts'oana le lileibole. Sebelisa.badge-pill
mofetoleli hammoho le karolo ea laibole bakeng sa chebahalo eo e chitja. - Libeche ha li sa phaphamala ka bo eona ka lihlopha tsa lenane le likarolo tse ling. Hona joale litlelase tsa utility lia hlokahala bakeng sa seo.
.badge-default
e lahliloe 'me.badge-secondary
ea eketsoa ho lihlopha tsa ho fetola likarolo tse sebelisoang libakeng tse ling.
E theotsoe ka botlalo bakeng sa karolo e ncha ea karete.
.panel
ho.card
, hona joale e hahiloeng ka flexbox..panel-default
e tlositsoe mme ha ho na sebaka..panel-group
e tlositsoe mme ha ho na sebaka..card-group
ha se phetoho, e fapane..panel-heading
ho.card-header
.panel-title
ho.card-title
. Ho ipapisitse le chebahalo e lakatsehang, u kanna ua batla ho sebelisa likarolo tsa sehlooho kapa litlelase (mohlala<h3>
,.h3
) kapa likarolo kapa litlelase tse sebete (mohlala<strong>
, ,<b>
,.font-weight-bold
). Hlokomela hore.card-title
, leha e rehiloe ka tsela e tšoanang, e hlahisa chebahalo e fapaneng le.panel-title
..panel-body
ho.card-body
.panel-footer
ho.card-footer
.panel-primary
,.panel-success
,.panel-info
,.panel-warning
, 'me.panel-danger
li lahliloe bakeng sa.bg-
,.text-
, le.border
lisebelisoa tse hlahisoang ho tsoa$theme-colors
'mapeng oa rona oa Sass.
.progress-bar-*
Litlelase tsa maemo a fetotsoeng ka.bg-*
lisebelisoa. Ka mohlala,class="progress-bar progress-bar-danger"
e fetohaclass="progress-bar bg-danger"
.- E nkeloe sebaka
.active
bakeng sa libaka tsa tsoelopele tse nang le.progress-bar-animated
.
- E ntlafalitse karolo eohle ho nolofatsa moralo le setaele. Re na le mekhoa e fokolang eo u ka e fetisang, matšoao a macha le litšoantšo tse ncha.
- Li-CSS tsohle ha li etsoe lihlaha le ho rehoa bocha, ho netefatsa hore sehlopha ka seng se ngotsoe ka
.carousel-
.- Bakeng sa lintho tsa carousel,
.next
,.prev
,.left
, le.right
hona joale.carousel-item-next
,.carousel-item-prev
,.carousel-item-left
, le.carousel-item-right
. .item
le hona joale.carousel-item
.- Bakeng sa litaolo tsa pele/tse latelang,
.carousel-control.right
'me.carousel-control.left
ke hona joale.carousel-control-next
le.carousel-control-prev
, ho bolelang hore ha li sa hloka sehlopha se itseng sa motheo.
- Bakeng sa lintho tsa carousel,
- E tlositse setaele sohle se arabelang, ho sebelisa lisebelisoa (mohlala, ho bonts'a mantsoe a qotsitsoeng libakeng tse itseng tsa pono) le mekhoa e tloaelehileng ha ho hlokahala.
- Litlaleho tse tlositsoeng tsa litšoantšo tsa lintho tsa carousel, tse lebisang ho lits'ebeletso.
- E ntlafalitse mohlala oa Carousel ho kenyelletsa letšoao le mekhoa e mecha.
- Ho tlositsoe tšehetso bakeng sa litafole tse entsoeng ka setaele. Mefuta eohle ea litafole e se e futsitsoe ho v4 bakeng sa bakhethoa ba bonolo.
- E kentse mofuta o fapaneng oa tafole.
- Hlahisa, e patiloe, le tse ling:
- E entse hore lisebelisoa tsa ponts'o li arabele (mohlala,
.d-none
led-{sm,md,lg,xl}-none
). - E lahlile bongata ba
.hidden-*
lisebelisoa bakeng sa lisebelisoa tse ncha tsa pontšo . Ka mohlala, sebakeng sa.hidden-sm-up
, sebelisa.d-sm-none
. E reha.hidden-print
lisebelisuoa bocha ho sebelisa sebopeho sa ho reha mabitso. Lintlha tse ling tlasa karolo ea Lisebelisuoa tse Arabang leqepheng lena. - Litlelase tse ekelitsoeng
.float-{sm,md,lg,xl}-{left,right,none}
bakeng sa liphaphatha tse arabelang le ho tlosoa.pull-left
,.pull-right
kaha ha li na thuso.float-left
ho.float-right
.
- E entse hore lisebelisoa tsa ponts'o li arabele (mohlala,
- Mofuta:
- E kenyellelitse liphapang tse arabelang litlelaseng tsa rona tsa tlhophiso ea mongolo
.text-{sm,md,lg,xl}-{left,center,right}
.
- E kenyellelitse liphapang tse arabelang litlelaseng tsa rona tsa tlhophiso ea mongolo
- Ho tsamaisana le sebaka:
- E kentse lisebelisoa tse ncha tse arabelang le tsa ho palama mahlakoreng 'ohle, hammoho le li-shorthand tse otlolohileng le tse tšekaletseng.
- Keketso ea likepe tsa lisebelisoa tsa flexbox .
- E theotsoe
.center-block
sehlopheng se secha.mx-auto
.
- Clearfix e ntlafalitsoe ho theola tšehetso bakeng sa mefuta ea khale ea sebatli.
Bootstrap 3's vendor prefix mixins, e neng e theohile ho v3.2.0, e tlositsoe Bootstrap 4. Kaha re sebelisa Autoprefixer , ha e sa hlokahala.
E tlositse metsoako e latelang :, animation
_ animation-delay
_ animation-direction
_ animation-duration
_ animation-fill-mode
_ animation-iteration-count
_ animation-name
_ animation-timing-function
_ backface-visibility
_ box-sizing
_ content-columns
_ hyphens
_ opacity
_ perspective
_ perspective-origin
_ rotate
_ rotateX
_ rotateY
_ scale
_ scaleX
_ scaleY
_ skew
_ transform-origin
_ transition-delay
_ transition-duration
_transition-property
transition-timing-function
transition-transform
translate
translate3d
user-select
Litokomane tsa rona le tsona li ile tsa ntlafatsoa hohle. Mona ke tlase tlase:
- Re ntse re sebelisa Jekyll, empa re na le li-plugins motsoakong:
bugify.rb
e sebelisoa ho thathamisa likenyo tse leqepheng la rona la liphoso tsa sebatli .example.rb
ke fereko e tloaelehileng eahighlight.rb
plugin ea kamehla, e lumellang hore ho be bonolo ho sebetsana le khoutu ea mohlala.callout.rb
ke fereko e tšoanang le eo, empa e etselitsoe li-callouts tsa rona tse khethehileng.markdown-block.rb
e sebelisetsoa ho fana ka linepe tsa Markdown ka har'a likarolo tsa HTML joalo ka litafole.- jekyll-toc e sebelisoa ho hlahisa lethathamo la litaba tsa rona.
- Litaba tsohle tsa litokomane li ngotsoe hape ho Markdown (ho e-na le HTML) bakeng sa ho hlophisa habonolo.
- Maqephe a hlophisitsoe bocha bakeng sa litaba tse bonolo le sehlopha sa maemo a holimo se atamelehang.
- Re tlohile ho CSS e tloaelehileng ho ea ho SCSS ho nka monyetla ka botlalo ka mefuta e fapaneng ea Bootstrap, metsoako, le tse ling.
Liphetoho tsohle @screen-
li tlositsoe ho v4.0.0. Sebelisa metsoako ea media-breakpoint-up()
, media-breakpoint-down()
, kapa media-breakpoint-only()
Sass kapa $grid-breakpoints
'mapa oa Sass ho e-na le hoo.
Litlelase tsa rona tse arabelang li tlositsoe haholo molemong oa display
lits'ebeletso tse hlakileng.
- The
.hidden
le.show
litlelase li tlositsoe hobane li hanana le jQuery's$(...).hide()
le$(...).show()
mekhoa. Ho e-na le hoo, leka ho fetola[hidden]
tšobotsi kapa sebelisa mekhoa e ka har'a marang-rang joalokastyle="display: none;"
lestyle="display: block;"
. - Lihlopha tsohle
.hidden-
li tlositsoe, ntle le lisebelisoa tsa khatiso tse fetoletsoeng.- E tlositsoe ho v3:
.hidden-xs
.hidden-sm
.hidden-md
.hidden-lg
.visible-xs-block
.visible-xs-inline
.visible-xs-inline-block
.visible-sm-block
.visible-sm-inline
.visible-sm-inline-block
.visible-md-block
.visible-md-inline
.visible-md-inline-block
.visible-lg-block
.visible-lg-inline
.visible-lg-inline-block
- E tlositsoe ho li-alphas tsa v4:
.hidden-xs-up
.hidden-xs-down
.hidden-sm-up
.hidden-sm-down
.hidden-md-up
.hidden-md-down
.hidden-lg-up
.hidden-lg-down
- E tlositsoe ho v3:
- Lisebelisoa tsa khatiso ha li sa qala ka
.hidden-
kapa.visible-
, empa ka.d-print-
.- Mabitso a khale:
.visible-print-block
,.visible-print-inline
,.visible-print-inline-block
,.hidden-print
- Lihlopha tse ncha:
.d-print-block
,.d-print-inline
,.d-print-inline-block
,.d-print-none
- Mabitso a khale:
Sebakeng sa ho sebelisa litlelase tse hlakileng .visible-*
, o etsa hore ntho e bonahale ka ho se e pate ka boholo ba skrineng. O ka kopanya .d-*-none
sehlopha se le seng le sehlopha se le seng .d-*-block
ho bonts'a ntho ka nako e itseng feela ea boholo ba skrine (mohlala, .d-none.d-md-block.d-xl-none
e bonts'a ntho ka lisebelisoa tse mahareng le tse kholo feela).
Hlokomela hore liphetoho ho li-breakpoints tsa grid ho v4 li bolela hore u tla hloka ho ea sebakeng se le seng se seholo ho fihlela sephetho se tšoanang. Likarolo tse ncha tse arabelang ha li leke ho amohela maemo a sa tloaelehang haholo moo ponahalo ea element e ke keng ea hlahisoa e le mefuta e le 'ngoe ea boholo ba sebaka sa pono; o tla hloka ho sebelisa CSS ea tloaelo maemong a joalo.