Reboot no bio
Reboot, element-specific CSS nsakraeɛ a wɔaboaboa ano wɔ fael baako mu, kickstart Bootstrap ma ɛde mfitiaseɛ a ɛyɛ fɛ, ɛkɔ so daa, na ɛnyɛ den a wobɛsi so.
Reboot gyina Normalize so, ɛma HTML elements pii a ɛwɔ adwene bi a ɛwɔ adwene a wɔde element selectors nkutoo di dwuma. Wɔde adesua ahorow nkutoo na ɛyɛ styling foforo. Sɛ nhwɛso no, yɛsan bɔ <table>
style ahorow bi ma baseline a ɛyɛ mmerɛw na akyiri yi yɛde .table
, .table-bordered
, ne nea ɛkeka ho ma.
Yɛn akwankyerɛ ne ntease ahorow a enti ɛsɛ sɛ wopaw nea ɛsɛ sɛ wobɔ so wɔ Reboot mu ni:
- Yɛ browser default values binom foforo na fa
rem
s di dwuma sen sɛ wode s bedi dwumaem
ama scalable component spacing. - Kwati sɛ
margin-top
. Nneɛma a ɛwɔ nkyɛnkyɛn a ɛda hɔ gyina hɔ no betumi abubu, na ɛde nneɛma a wɔnhwɛ kwan aba. Nanso nea ɛho hia kɛse no, akwankyerɛ biako a wɔde mamargin
ne adwene mu nhwɛso a ɛyɛ mmerɛw. - Sɛnea ɛbɛyɛ a ɛbɛyɛ mmerɛw sɛ wobɛma scaling wɔ device sizes nyinaa mu no, ɛsɛ sɛ block elements de s di dwuma
rem
mamargin
s. - Ma mpaemuka a
font
ɛfa -a ɛfa agyapade ho no nyɛ nea ɛba fam koraa, fa di dwumainherit
bere biara a ɛbɛyɛ yiye.
Wɔayɛ <html>
ne <body>
elements no foforo de ama kratafa no nyinaa defaults a eye. Nea ɛkɔ akyiri yi:
- Wɔde
box-sizing
wiase nyinaa asi element biara so—a*::before
ne , ka ho*::after
, kosiborder-box
. Wei hwɛ sɛ element no trɛw a wɔabɔ ho dawuru no rentra da esiane padding anaa border nti.- Wɔmmɔ nnyinaso
font-size
biara ho dawuru wɔ<html>
, nanso16px
wɔfa no sɛ (browsa no default).font-size: 1rem
wɔde di dwuma wɔ the<body>
for easy responsive type-scaling via media queries bere a wɔkyerɛ obu ma nea ɔde di dwuma no apɛde na ɛhwɛ hu sɛ wɔfa ɔkwan a ɛyɛ mmerɛw so.
- Wɔmmɔ nnyinaso
- The
<body>
nso de wiase nyinaafont-family
,line-height
, netext-align
. Eyi fi awo mu akyiri yi denam form elements binom so de siw font a enhyia ano. - Sɛnea ɛbɛyɛ a ahobammɔ bɛba no, the
<body>
has abackground-color
declared , defaulting to#fff
.
Wɔagyae wɛb nkyerɛwde a wɔde ahyɛ hɔ (Helvetica Neue, Helvetica, ne Arial) wɔ Bootstrap 4 mu na wɔde “native font stack” asi ananmu ama nsɛm a wɔbɛkyerɛ ase yiye wɔ mfiri ne OS biara so. Kenkan native font stacks ho nsɛm pii wɔ Smashing Magazine asɛm yi mu .
Eyi font-family
yɛ nea wɔde di dwuma wɔ <body>
ne automatically inherited wiase nyinaa wɔ Bootstrap nyinaa mu. Sɛ wopɛ sɛ wosakra global font-family
, update $font-family-base
na san boaboa Bootstrap ano.
Asɛmti no mu nneɛma nyinaa—sɛ nhwɛso no, <h1>
—na <p>
wɔsan de si hɔ sɛnea ɛbɛyɛ a wobeyi wɔn margin-top
afi hɔ. Wɔde nsɛmti ahorow margin-bottom: .5rem
aka ho ne nkyekyem margin-bottom: 1rem
ahorow a ɛbɛma ntam kwan ayɛ mmerɛw.
Asɛmti | Nhwɛsoɔ |
---|---|
|
h1. Bootstrap asɛmti no |
|
h2. Bootstrap asɛmti no |
|
h3. Bootstrap asɛmti no |
|
h4. Bootstrap asɛmti no |
|
h5. Bootstrap asɛmti no |
|
h6. Bootstrap asɛmti no |
Lists nyinaa— <ul>
, <ol>
, ne <dl>
—wɔ wɔn a margin-top
wɔayi afi hɔ ne a margin-bottom: 1rem
. Nested list ahorow no nni margin-bottom
.
- Lorem ipsum dolor tena ase amet
- Consectetur adipiscing a ɛyɛ fɛ yiye
- Integer molestie lorem wɔ massa no mu
- Facilisis a ɛwɔ pretium nisl aliquet mu
- Nulla volutpat a ɛyɛ aduru a wɔde yɛ aduru
- Phasellus iaculis a ɛwɔ nipadua no mu
- Purus sodales a ɛyɛ aduru a ɛma obi ho yɛ hyew
- Vestibulum laoreet hyɛn gyinabea sem
- Ac tristique libero a ɔyɛ ɔbarima a ɔpɛ sɛ ɔyɛ biribiara
- Faucibus porta lacus a ɛyɛ fɛ a ɛyɛ fɛ
- Aenean tena ase amet erat nunc
- Eget porttitor a ɔyɛ ɔkyerɛkyerɛfo
- Lorem ipsum dolor tena ase amet
- Consectetur adipiscing a ɛyɛ fɛ yiye
- Integer molestie lorem wɔ massa no mu
- Facilisis a ɛwɔ pretium nisl aliquet mu
- Nulla volutpat a ɛyɛ aduru a wɔde yɛ aduru
- Faucibus porta lacus a ɛyɛ fɛ a ɛyɛ fɛ
- Aenean tena ase amet erat nunc
- Eget porttitor a ɔyɛ ɔkyerɛkyerɛfo
Sɛnea ɛbɛyɛ a wobɛhyehyɛ no mmerɛw, nhyehyɛe a emu da hɔ, ne ntam kwan a eye no, nkyerɛkyerɛmu list ahorow no ayɛ margin
s foforo. <dd>
s reset margin-left
to 0
na fa ka ho margin-bottom: .5rem
. <dt>
s no yɛ nkyerɛwde tuntum .
- Nkyerɛkyerɛmu a wɔahyehyɛ
- Nkyerɛkyerɛmu a wɔahyehyɛ no yɛ pɛpɛɛpɛ ma nsɛmfua nkyerɛase.
- Euismod ho asɛm
- Vestibulum id ligula porta felis euismod semper a ɛyɛ mmerɛw sɛ wobɛbɔ wo bra no.
- Donec id elit a ɛnyɛ mi porta gravida wɔ eget metus.
- Malesuada a ɛwɔ porta
- Etiam porta sem ɔbarima a ɔyɛ ɔbarima a ɔyɛ ɔbarima.
Wɔsan <pre>
de element no si hɔ de yi ne margin-top
na wɔde rem
units di dwuma ma ne margin-bottom
.
.nhwɛsoɔ-adeɛ { . margin-ase: 1rem; } .
Wɔayɛ pon ahorow no ho nhyehyɛe kakra ma ɛne style <caption>
s, collapse borders, na wɔhwɛ hu sɛ ɛkɔ so daa wɔ ne text-align
nyinaa mu. Nsakrae foforo a ɛfa borders, padding, ne nea ɛkeka ho no ka .table
adesuakuw no ho .
Table asɛmti | Table asɛmti | Table asɛmti | Table asɛmti |
---|---|---|---|
Table cell | Table cell | Table cell | Table cell |
Table cell | Table cell | Table cell | Table cell |
Table cell | Table cell | Table cell | Table cell |
Wɔasan ahyɛ form elements ahorow ase ama base styles a ɛyɛ mmerɛw. Nsakrae a ɛda nsow sen biara no bi ni:
<fieldset>
s nni borders, padding, anaa margin enti wobetumi de adi dwuma mmerɛw sɛ wrappers ama ankorankoro inputs anaa inputs akuw.<legend>
s, te sɛ fieldsets, nso wɔasan ayɛ no foforo sɛnea ɛbɛyɛ a wɔbɛda no adi sɛ asɛmti a ɛyɛ ahorow.<label>
s no wɔde asi hɔ sɛdisplay: inline-block
wɔbɛma kwanmargin
ma wɔde adi dwuma.<input>
s,<select>
s,<textarea>
s, ne<button>
s no, Normalize na ɛdi ho dwuma dodoɔ no ara, nanso Reboot yi wɔnmargin
ne setline-height: inherit
, nso.<textarea>
s no yɛ nsakrae ma ɛyɛ nea wotumi sesa ne kɛse vertically nkutoo sɛnea horizontal resizing taa “bubu” kratafa nhyehyɛe no.
Wɔada nsakrae ahorow yi, ne nea ɛkeka ho adi wɔ ase ha.
Wɔayɛ <address>
element no foforo de asan ahyɛ browser no default no font-style
afi italic
kɔ normal
. line-height
no nso mprempren anya agyapade, na margin-bottom: 1rem
wɔde aka ho. <address>
s yɛ nea wɔde bɛma nana a ɔbɛn no paa (anaasɛ adwuma mũ no nyinaa) nkitahodi ho nsɛm. Kora formatting so denam nkyerɛwde a wode bɛhyɛ awiei no so <br>
.
Default margin
a ɛwɔ blockquotes so ne 1em 40px
, enti yɛsan de saa to 0 0 1rem
hɔ ma biribi a ɛne nneɛma afoforo hyia kɛse.
Lorem ipsum dolor tena amet, consectetur adipiscing a ɛyɛ fɛ a ɛyɛ fɛ. Nkyekyɛm a edi mũ posuere erat a ante.
Element <abbr>
no nya mfitiase styling ma ɛda nsow wɔ nkyekyɛm nsɛm mu.
Default cursor
wɔ summary so ne text
, enti yɛsan de saa to pointer
no de kyerɛ sɛ wobetumi ne element no adi nkitaho denam klik a wobɛbɔ so.
Nsɛm bi a ɛkɔ akyiri
More info fa nsɛm no ho.
Nsɛm pii mpo
Nsɛm pii mpo a ɛfa nsɛm no ho ni.
HTML5 de wiase nyinaa su foforo a wɔato din[hidden]
, a wɔayɛ no sɛnea display: none
ɛte no ka ho. Borrowing an idea from PureCSS , yɛtu mpɔn wɔ saa default yi so denam yɛ a yɛbɛyɛ [hidden] { display: none !important; }
de aboa ma wɔasiw ne display
kwan sɛ ɛbɛba so wɔ akwanhyia mu no so. Bere [hidden]
a ɛnyɛ natively supported by IE10, pefee mpaemuka wɔ yɛn CSS no di saa ɔhaw no ho dwuma.
jQuery a ɛne ne ho nhyia
[hidden]
no ne jQuery's $(...).hide()
ne $(...).show()
akwan horow no nhyia. Enti, mprempren yɛnyɛ titiriw endorse [hidden]
over akwan afoforo a wɔfa so di display
of elements no ho dwuma.
Sɛ wopɛ sɛ wodannan element bi a wotumi hu no ara kwa, a ɛkyerɛ display
sɛ wɔansakra ne na element no da so ara tumi nya krataa no nsu a ɛsen no so nkɛntɛnso a, fa adesuakuw no.invisible
di dwuma mmom.