Sɛnea worefi ase
Bootstrap ho nsɛm a wɔaka abom, sɛnea wobɛtwe na wode adi dwuma, mfitiase template ne nhwɛso ahorow, ne nea ɛkeka ho.
Bootstrap ho nsɛm a wɔaka abom, sɛnea wobɛtwe na wode adi dwuma, mfitiase template ne nhwɛso ahorow, ne nea ɛkeka ho.
Bootstrap (mprempren v3.3.7) wɔ akwan kakraa bi a ɛyɛ mmerɛw a wobɛfa so afi ase ntɛm, emu biara yɛ anigye ma ahokokwaw gyinabea ne dwumadie tebea soronko. Kenkan kɔ akyiri na woahu nea ɛfata w’ahiade pɔtee no.
Wɔaboaboa CSS, JavaScript, ne nkyerɛwde ahorow ano na wɔayɛ no ketewaa. Docs anaa mfitiaseɛ source fael biara nka ho.
Source Less, JavaScript, ne font fael ahorow, ne yɛn docs. Ɛhwehwɛ sɛ wonya Less compiler ne nhyehyɛe bi.
Bootstrap ported fi Less kɔɔ Sass maa ɛnyɛ den sɛ wɔde bɛka Rails, Compass, anaa Sass-only nnwuma ho.
Nnipa a wɔwɔ jsDelivr no de ayamye ma CDN mmoa ma Bootstrap CSS ne JavaScript. Fa saa Bootstrap CDN links yi di dwuma kɛkɛ.
Wubetumi nso de Bower ahyɛ Bootstrap Less, CSS, JavaScript, ne nkyerɛwde ahorow no so na woahwɛ so :
Wubetumi nso de npm ahyɛ Bootstrap no mu :
require('bootstrap')
bɛfa Bootstrap jQuery plugins no nyinaa akɔ jQuery adeɛ no so. Module bootstrap
no ankasa ntumi nkɔ amannɔne. Wubetumi de nsa ahyɛ Bootstrap jQuery plugins no ankorankoro denam /js/*.js
fael ahorow a wode bɛhyɛ package no top-level directory ase no so.
Bootstrap's no package.json
kura metadata foforo bi wɔ nsafe a edidi so yi ase:
less
- kwan a ɛkɔ Bootstrap no Less source fael titiriw no sostyle
- kwan a ɛkɔ Bootstrap CSS a wɔanyɛ no ketewaa a wɔadi kan aboaboa ano denam nhyehyɛe a wɔde ahyɛ hɔ no so (wɔnyɛ nsakrae biara) .Wubetumi nso de Composer ahyɛ Bootstrap Less, CSS, JavaScript, ne fonts no so na woahwɛ so :
Bootstrap de Autoprefixer di dwuma de di CSS adetɔnfo anim nsɛm ho dwuma . Sɛ woreboaboa Bootstrap ano afiri ne Less/Sass fibea na womfa yɛn Gruntfile no nni dwuma a, ɛho behia sɛ w’ankasa wode Autoprefixer bɛka wo dan nhyehyɛe no ho. Sɛ wode Bootstrap a wɔadi kan aboaboa ano redi dwuma anaasɛ wode yɛn Gruntfile no redi dwuma a, enhia sɛ wohaw wo ho wɔ eyi ho efisɛ wɔde Autoprefixer ahyɛ yɛn Gruntfile no mu dedaw.
Bootstrap no yɛ nea wobetumi atwe wɔ akwan abien so, a ɛwɔ mu no wubehu nkyerɛwde ne fael ahorow a edidi so yi, a ntease wom a ɛboaboa nneɛma a wɔtaa de di dwuma no ano na ɛde nsakrae ahorow a wɔaboaboa ano ne nea wɔayɛ no ketewaa nyinaa ama.
Yɛsrɛ wo hyɛ no nsow sɛ JavaScript plugins nyinaa hwehwɛ sɛ wɔde jQuery ka ho, sɛnea wɔakyerɛ wɔ starter template no mu no . Hwɛ yɛnbower.json
na hwɛ jQuery nkyerɛase ahorow a wɔboa.
Sɛ wotwe wie a, yi folda a wɔahyɛ no den no na wubehu sɛnea Bootstrap (a wɔaboaboa ano no) no te. Wobɛhunu biribi a ɛte sɛɛ:
Eyi ne Bootstrap no kwan titiriw sen biara: fael ahorow a wɔadi kan aboaboa ano a wɔde di dwuma ntɛmntɛm wɔ ɛkame ayɛ sɛ wɛb adwuma biara mu. Yɛde CSS ne JS a wɔaboaboa ano ( bootstrap.*
), ne CSS ne JS ( ) a wɔaboaboa ano na wɔayɛ no ketewaa nso ma bootstrap.min.*
. CSS source maps ( bootstrap.*.map
) wɔ hɔ a wobetumi de adi dwuma wɔ browser ahorow bi developer nnwinnade mu. Fonts a efi Glyphicons no ka ho, sɛnea Bootstrap asɛmti a wopɛ no nso te.
Bootstrap source code download no ka CSS, JavaScript, ne font agyapade a wɔadi kan aboaboa ano no ho, ne source Less, JavaScript, ne nkrataa. Nea ɛkɔ akyiri no, nea edidi so yi ne nea ɛkeka ho ka ho:
less/
, js/
, ne no yɛ yɛn CSS fonts/
, JS, ne ahyɛnsode nkyerɛwde ahorow no fibea koodu (sɛnea ɛte biara). dist/
Biribiara a wɔakyerɛw wɔ ɔfã a wɔadi kan aboaboa ano a wɔatwe wɔ atifi hɔ no ka folda no ho . docs/
Folda no wɔ source code a yɛde yɛ yɛn nkrataa no, ne Bootstrap examples/
dwumadie ho. Ɛno akyi no, fael foforo biara a ɛka ho no ma mmoa ma packages, tumi krataa ho nsɛm, ne nkɔso.
Bootstrap de Grunt di dwuma ma ne dan nhyehyɛe, a akwan a ɛyɛ mmerɛw a wɔfa so ne framework no yɛ adwuma. Ɛyɛ sɛnea yɛboaboa yɛn code ano, yɛyɛ sɔhwɛ ahorow, ne nea ɛkeka ho.
Sɛ wopɛ sɛ wo instɔl Grunt a, ɛsɛ sɛ wudi kan twe na wo instɔl node.js (a npm ka ho). npm gyina hɔ ma node packaged modules na ɛyɛ ɔkwan a wɔfa so hwɛ nkɔso dependencies so denam node.js so.
Afei, efi ahyɛde no so:grunt-cli
wiase nyinaa ne npm install -g grunt-cli
./bootstrap/
directory no so, afei tu mmirika npm install
. npm bɛhwɛ package.json
fael no na ɔde ne ho ahyɛ local dependencies a ɛho hia a wɔakyerɛw wɔ hɔ no.Sɛ wowie a, wobɛtumi ayɛ Grunt ahyɛdeɛ ahodoɔ a wɔde ama no afiri ahyɛdeɛ kwan no so.
grunt dist
(Wɔboaboa CSS ne JavaScript ano kɛkɛ)Ɛsan /dist/
de CSS ne JavaScript fael ahorow a wɔaboaboa ano na wɔayɛ no ketewaa no san yɛ daerekta no. Sɛ́ Bootstrap dwumayɛni no, eyi taa yɛ ahyɛde a wopɛ.
grunt watch
(Hwɛ)Hwɛ Less source fael ahorow no na ɔsan boaboa ano kɔ CSS so bere biara a wode nsakrae bi besie.
grunt test
(Mmirikatu sɔhwɛ ahorow) .Run JSHint na ɛyɛ QUnit sɔhwɛ ahorow no ti a enni mu wɔ PhantomJS mu .
grunt docs
(Si & sɔ docs agyapade no hwɛ)Ɔkyekye na ɔsɔ CSS, JavaScript, ne agyapadeɛ foforɔ a wɔde di dwuma berɛ a wɔreyɛ nkrataa no wɔ mpɔtam hɔ denam bundle exec jekyll serve
.
grunt
(Si biribiara koraa na tu mmirika sɔhwɛ ahorow)Ɔboaboa CSS ne JavaScript ano na ɛyɛ ketewaa, ɛkyekyere nkrataa wɛbsaet no, ɔde HTML5 validator no di dwuma tia docs no, ɛsan yɛ Customizer agyapade no, ne nea ɛkeka ho. Ɛhwehwɛ sɛ Jekyll . Mpɛn pii no, sɛ woreyɛ hacking wɔ Bootstrap ankasa so nkutoo a, ɛho hia.
Sɛ ɛsɛ sɛ wuhyia ɔhaw ahorow wɔ dependencies a wobɛhyehyɛ anaa Grunt ahyɛde ahorow a wode reyɛ adwuma no mu a, di kan popa /node_modules/
daerekta a npm ayɛ no. Afei, san tu mmirika bio npm install
.
Fi ase de HTML nsusuwso titiriw yi, anaa sesa nhwɛso ahorow yi . Yɛwɔ anidaso sɛ wobɛsesa yɛn nsusuiɛ ne nhwɛsoɔ no, ayɛ nsakraeɛ ama ɛne w’ahiadeɛ ahyia.
Kɔpi HTML a ɛwɔ aseɛ ha no na hyɛ aseɛ de Bootstrap krataa a ɛsua koraa yɛ adwuma.
Fa Bootstrap no afã horow pii no si mfitiase nsusuwso a ɛwɔ atifi hɔ no so. Yɛhyɛ wo nkuran sɛ yɛ Bootstrap no ho nhyehyɛe na yɛ nsakrae ma ɛne w’ankorankoro adwuma no ahiade ahorow nhyia.
Nya source code ma nhwɛso biara a ɛwɔ ase ha no denam Bootstrap adekorabea no a wobɛtwe so . Wobetumi ahu nhwɛso ahorow wɔ docs/examples/
kyerɛwtohɔ no mu.
Biribiara nni hɔ gye mfitiaseɛ no: wɔaboaboa CSS ne JavaScript ano aka container bi ho.
Blog nhyehyɛe a ɛnyɛ den a ɛwɔ nkyerɛwde abien a ɛwɔ akwantu a wɔahyɛ da ayɛ, atiri, ne type.
Yɛ navbar a wɔahyɛ da ayɛ a ɛwɔ link ahorow a ɛfata. Ti a ɛwɔ soro! Ɛnyɛ Safari adamfofa su dodo.
Bootlint yɛ Bootstrap HTML linter adwinnade a ɛyɛ aban de. Ɛhwɛ HTML mfomso ahorow pii a ɛtaa ba wɔ wɛbsaet nkratafa a ɛde Bootstrap redi dwuma wɔ "vanilla" kwan a ɛfata so no ankasa. Vanilla Bootstrap no afã horow/widgets no hwehwɛ sɛ wɔn afã horow a ɛwɔ DOM no mu no ne nhyehyɛe ahorow bi hyia. Bootlint hwɛ sɛ Bootstrap afã horow no nhwɛso ahorow wɔ HTML a wɔahyehyɛ no yiye. Susuw ho sɛ wode Bootlint bɛka wo Bootstrap wɛb nkɔso adwinnade ho sɛnea ɛbɛyɛ a mfomso a ɛtaa ba no mu biara remma wo dwumadi no nkɔso brɛ ase.
Kɔ so nya Bootstrap nkɔsoɔ ho nsɛm na fa saa nneɛma a ɛboa yi kɔ mpɔtam hɔfoɔ nkyɛn.
irc.freenode.net
server no mu no nkɔmmɔ, wɔ ##bootstrap channel no mu.twitter-bootstrap-3
.bootstrap
wɔ packages a ɛsesa anaa ɛde ka Bootstrap dwumadie ho berɛ a wɔrekyekyɛ denam npm anaa delivery mechanisms a ɛte saa ara so ama maximum discoverability.Wubetumi nso adi @getbootstrap akyi wɔ Twitter so ama nsɛmmɔnedi ne nnwom video ahorow a ɛyɛ hu a aba foforo.
Bootstrap no ankasa sesa wo nkratafa no ma screen akɛse ahorow. Sɛnea wobɛma saa ade yi ayɛ adwuma sɛnea ɛbɛyɛ a wo krataafa no bɛyɛ adwuma te sɛ nhwɛso a ɛnyɛ mmuae yi ni .
<meta>
wɔaka ho asɛm wɔ CSS docs no mu no fi muwidth
on the .container
ma grid tier biara a ɛwɔ ntrɛwmu biako, sɛ nhwɛso no width: 970px !important;
Hwɛ sɛ eyi ba Bootstrap CSS default no akyi. Wubetumi apaw akwati !important
ne media nsɛmmisa anaasɛ selector-fu bi..col-xs-*
adesua ahodoɔ ka, anaa si ananmu, deɛ ɛwɔ mfimfini/kɛseɛ no. Mma ɛnhaw wo, extra-small device grid no nsenia ma resolutions nyinaa.Wobɛda so ara hia Respond.js ama IE8 (esiane sɛ yɛn media nsɛmmisa no da so ara wɔ hɔ na ɛsɛ sɛ wɔyɛ ho adwuma). Wei ma "mobile site" afã horow a ɛwɔ Bootstrap no yɛ adwuma.
Yɛde saa anammɔn yi adi dwuma wɔ nhwɛso bi mu. Kenkan ne source code no na woahu nsakrae pɔtee a wɔde adi dwuma.
Worehwehwɛ sɛ wobɛtu afiri Bootstrap dedaw bi mu akɔ v3.x? Hwɛ yɛn akwantu ho akwankyerɛ nhoma no .
Wɔayɛ Bootstrap sɛ ɛbɛyɛ adwuma yiye wɔ desktop ne mobile browser ahorow a aba foforo no mu, a ɛkyerɛ sɛ browser dedaw no betumi akyerɛ nneɛma ahorow bi nkyerɛase ahorow a wɔayɛ no ɔkwan soronko so, ɛwom sɛ ɛyɛ adwuma koraa de.
Titiriw no, yɛboa browser ne platform ahorow a edidi so yi a aba foforo no .
Browsa foforo a ɛde WebKit, Blink, anaa Gecko a aba foforo di dwuma, sɛ ɛyɛ tẽẽ anaasɛ ɛnam platform no wɛb hwɛ API so no, wɔmfa mmoa pefee. Nanso, ɛsɛ sɛ Bootstrap (wɔ nsɛm dodow no ara mu) da adi na ɛyɛ adwuma yiye wɔ saa browser ahorow yi nso mu. Wɔde mmoa ho nsɛm pɔtee pii ama wɔ ase ha.
Sɛ yɛbɛka no ɔkwan biara so a, Bootstrap boa platform kɛse biara default browser ahorow no nkyerɛase a aba foforo. Hyɛ no nsow sɛ wɔmfa proxy brawsa ahorow (te sɛ Opera Mini, Opera Mobile no Turbo mode, UC Browser Mini, Amazon Silk) ntom.
Chrome na ɛwɔ hɔ | Firefox a ɛwɔ hɔ | Safari a wɔde di dwuma | |
---|---|---|---|
Android so | Wɔboaa no | Wɔboaa no | N/A na ɛwɔ hɔ |
iOS a ɛwɔ hɔ no | Wɔboaa no | Wɔboaa no | Wɔboaa no |
Saa ara nso na wɔboa desktop browser dodow no ara a aba foforo no.
Chrome na ɛwɔ hɔ | Firefox a ɛwɔ hɔ | Intanɛt so Nhwehwɛmu | Opera | Safari a wɔde di dwuma | |
---|---|---|---|---|---|
Mac na ɛwɔ hɔ | Wɔboaa no | Wɔboaa no | N/A na ɛwɔ hɔ | Wɔboaa no | Wɔboaa no |
Windows a ɛwɔ hɔ | Wɔboaa no | Wɔboaa no | Wɔboaa no | Wɔboaa no | Wɔmfa mmoa mma |
Wɔ Windows so no, yɛboa Internet Explorer 8-11 .
Firefox deɛ, ɛde ka normal stable release a ɛtwa toɔ ho no, yɛsan nso boa Extended Support Release (ESR) version a ɛtwa toɔ a ɛwɔ Firefox no mu.
Wɔ ɔkwan a ɛnyɛ aban kwan so no, ɛsɛ sɛ Bootstrap hwɛ na ɛyɛ n’ade yiye sɛnea ɛsɛ wɔ Chromium ne Chrome ma Linux, Firefox ma Linux, ne Internet Explorer 7, ne Microsoft Edge nso, ɛwom sɛ wɔmfa aban mmoa mma de.
Sɛ wopɛ browser bugs a ɛsɛ sɛ Bootstrap di ho dwuma no bi din a, hwɛ yɛn Wall of browser bugs .
Internet Explorer 8 ne 9 nso wɔboa, nanso, yɛsrɛ wo hu sɛ CSS3 agyapade bi ne HTML5 nneɛma bi ntumi mmoa saa browser ahorow yi koraa. Bio nso, Internet Explorer 8 hwehwɛ sɛ wode Respond.js di dwuma na ama media asɛmmisa mmoa atumi ayɛ adwuma.
Su | Intanɛt so Nhwehwɛmu 8 | Intanɛt so Nhwehwɛmu 9 |
---|---|---|
border-radius |
Wɔmfa mmoa mma | Wɔboaa no |
box-shadow |
Wɔmfa mmoa mma | Wɔboaa no |
transform |
Wɔmfa mmoa mma | Wɔboa, a wɔde -ms prefix ahyɛ mu |
transition |
Wɔmfa mmoa mma | |
placeholder |
Wɔmfa mmoa mma |
Kɔ So metumi de adi dwuma... na woanya nsɛm a ɛfa browser mmoa a ɛfa CSS3 ne HTML5 nneɛma ho.
Hwɛ yiye wɔ kɔkɔbɔ ahorow a edidi so yi ho bere a wode Respond.js redi dwuma wɔ wo nkɔso ne nnwumayɛbea ahorow ma Internet Explorer 8 no.
Sɛ wode Respond.js bedi dwuma a CSS a wɔagye wɔ (sub)domain soronko so (sɛ nhwɛso no, wɔ CDN so) a, ɛhwehwɛ sɛ woyɛ nhyehyɛe foforo bi. Hwɛ Respond.js docs no ma nsɛm no mu nsɛm.
file://
Esiane browser ahobanbɔ mmara nti, Respond.js ntumi nyɛ adwuma wɔ nkratafa a wɔhwɛ denam file://
protocol no so (te sɛ bere a worebue HTML fael a ɛwɔ mpɔtam hɔ). Sɛ wopɛ sɛ wosɔ nneɛma a ɛyɛ adwuma hwɛ wɔ IE8 mu a, hwɛ wo nkratafa no wɔ HTTP(S) so. Hwɛ Respond.js docs no ma nsɛm no mu nsɛm.
@import
Respond.js nnyɛ adwuma wɔ CSS a wɔde kyerɛkyerɛ mu denam @import
. Titiriw no, wonim sɛ Drupal nhyehyɛe ahorow bi de @import
. Hwɛ Respond.js docs no ma nsɛm no mu nsɛm.
IE8 ntumi mmoa koraa box-sizing: border-box;
bere a wɔde ka min-width
, max-width
, min-height
, anaa max-height
. Ɛno nti, ɛfiri v3.0.1 no, yɛmfa nni dwuma bio max-width
wɔ .container
s.
IE8 wɔ nsɛm bi a ɛfa @font-face
bere a wɔde ka ho ne :before
. Bootstrap de saa nkabom no di dwuma ne ne Glyphicons. Sɛ wɔde krataafa bi ahyɛ cache mu, na wɔde ahyɛ mu a mouse nka ho wɔ mfɛnsere no so (kyerɛ sɛ, bɔ refresh button no anaa fa biribi gu iframe mu) a, ɛnde krataafa no nya rendered ansa na font no ahyɛ mu. Sɛ wode wo nsa hyɛ kratafa (nipadua) no so a, ɛbɛkyerɛ ahyɛnsode ahorow no bi na sɛ wode wo nsa hyɛ ahyɛnsode ahorow a aka no so a, ɛbɛkyerɛ wɔn nso. Hwɛ nsɛmma nhoma #13863 ma nsɛm no mu nsɛm.
Bootstrap no nnyɛ adwuma wɔ Internet Explorer a ɛne no hyia dedaw no mu. Sɛnea ɛbɛyɛ a wubehu sɛ wode rendering mode a aba foforo no redi dwuma ama IE no, susuw ho sɛ <meta>
wode tag a ɛfata no bɛka wo nkratafa no ho:
Si krataa mode no so dua denam debugging nnwinnade a wubebue no so: mia F12na hwɛ "Document Mode" no.
Saa tag yi ka Bootstrap nkrataa ne nhwɛso ahorow nyinaa ho de hwɛ hu sɛ wɔbɛkyerɛ nkyerɛase a eye sen biara wɔ Internet Explorer no fã biara a wɔboa no mu.
Hwɛ StackOverflow asɛmmisa yi ma nsɛm pii.
Internet Explorer 10 nkyerɛ nsonsonoe a ɛda mfiri no tɛtrɛtɛ ne viewport ntrɛwmu ntam , na ɛnam saa kwan yi so mfa media nsɛmmisa a ɛwɔ Bootstrap CSS no mu no nni dwuma yiye. Mpɛn pii no, anka wode CSS no fã bi a ɛyɛ ntɛm bɛka ho kɛkɛ de asiesie eyi:
Nanso, eyi nyɛ adwuma mma mfiri a ɛde Windows Phone 8 nkyerɛase a akyɛ sen Update 3 (a wɔfrɛ no GDR3) , efisɛ ɛma mfiri a ɛtete saa no kyerɛ desktop hwɛbea dodow no ara sen sɛ ɛbɛkyerɛ "fon" hwɛbea teateaa. Sɛ wopɛ sɛ wodi eyi ho dwuma a, ɛho behia sɛ wode CSS ne JavaScript a edidi so yi ka ho na ama woatumi adi mfomso no ho dwuma .
Sɛ wopɛ nsɛm pii ne akwankyerɛ a wode bedi dwuma a, kenkan Windows Phone 8 ne Device-Width .
Sɛ́ heads up no, yɛde eyi ka Bootstrap nkrataa ne nhwɛso ahorow nyinaa ho sɛ ɔyɛkyerɛ.
Rendering engine a ɛwɔ Safari nkyerɛase ahorow a edi v7.1 anim ma OS X ne Safari ma iOS v8.0 no nyaa ɔhaw bi wɔ decimal mmeae dodow a wɔde di dwuma wɔ yɛn .col-*-1
grid adesua ahorow no mu no ho. Enti sɛ wowɔ grid columns ankorankoro 12 a, wobɛhyɛ no nsow sɛ ɛbaa tiawa sɛ wɔde toto columns a ɛtoatoa so afoforo ho a. Sɛ Safari/iOS a wobɛma ayɛ foforo no da nkyɛn a, wowɔ akwan bi a wobɛfa so ayɛ adwuma:
.pull-right
wo grid column a etwa to no ho na woanya hard-right alignment noMmoa ma overflow: hidden
wɔ <body>
element no so no yɛ kakraa bi koraa wɔ iOS ne Android mu. Nea ɛbɛyɛ na woatumi ayɛ saa no, sɛ wokɔ modal bi atifi anaa ase wɔ saa mfiri ahorow no browser ahorow no mu biara mu a, <body>
emu nsɛm no befi ase atutu. Hwɛ Chrome bɔne #175502 (wɔasiesie wɔ Chrome v40 mu) ne WebKit bɔne #153852 .
Ɛde besi iOS 9.3 no, bere a modal bi abue no, sɛ nhoma mmobɔwee sɛnkyerɛnne bi a wɔde wɔn nsa ka mfiase no wɔ nkyerɛwee <input>
anaa a hye mu a <textarea>
, <body>
wɔbɛkyerɛw nsɛm a ɛwɔ modal no ase no sen sɛ wɔbɛkyerɛw modal no ankasa. Hwɛ WebKit bɔne #153856 .
Afei nso, hyɛ no nsow sɛ sɛ wode navbar a wɔahyɛ da ayɛ redi dwuma anaasɛ wode inputs redi dwuma wɔ modal mu a, iOS wɔ rendering bug a ɛnsakra fixed elements no gyinabea bere a wɔahyɛ virtual keyboard no ase no. Nneɛma kakraa bi a wobɛfa so ayɛ eyi ne sɛ wobɛdan wo elements no akɔ position: absolute
anaasɛ wobɛfrɛ timer wɔ focus so de abɔ mmɔden sɛ wode nsa besiesie gyinabea no. Eyi nyɛ Bootstrap na edi ho dwuma, enti ɛyɛ wo na wubesi ano aduru a eye ma wo application no ho gyinae.
Wɔmfa .dropdown-backdrop
element no nni dwuma wɔ iOS so wɔ nav no mu esiane z-indexing a ɛyɛ den nti. Enti, sɛ wobɛto dropdowns mu wɔ navbars mu a, ɛsɛ sɛ wobɔ dropdown element no tẽẽ (anaasɛ element foforo biara a ɛbɛtow click event wɔ iOS ).
Kratafa a wɔde yɛ kɛse no de rendering artifacts kyerɛ wɔ nneɛma bi mu a wontumi nkwati, wɔ Bootstrap ne wɛb no fã a aka no nyinaa mu. Ɛgyina asɛm no so no, ebia yebetumi asiesie (di kan hwehwɛ na afei sɛ ɛho hia a, bue asɛm bi). Nanso, yɛtaa bu yɛn ani gu eyinom so sɛnea wɔtaa nni ano aduru tẽẽ biara gye hacky workarounds.
:hover
/ :focus
wɔ mobile soƐwom mpo sɛ hovering ankasa ntumi nyɛ yiye wɔ touchscreen dodow no ara so de, nanso mobile browser dodow no ara suasua hovering mmoa na ɛma :hover
"sticky". Ɔkwan foforo so no, :hover
styles fi ase de di dwuma bere a woabɔ element bi awie no na egyae di dwuma bere a nea ɔde di dwuma no abɔ element foforo bi akyi nkutoo. Eyi betumi ama Bootstrap :hover
tebea horow no ayɛ "akɔhyɛ" wɔ browser ahorow a ɛtete saa so wɔ ɔkwan a wɔmpɛ so. Mobile browser ahorow bi nso yɛ nea :focus
ɛyɛ nnam saa ara. Mprempren biribiara nni hɔ a ɛyɛ mmerɛw a wɔde bedi nsɛm yi ho dwuma gye sɛ wobeyi ntade a ɛtete saa afi hɔ koraa.
Wɔ nnɛyi browser ahorow bi mu mpo no, nhoma tintim betumi ayɛ nea ɛyɛ nwonwa.
Titiriw, sɛnea ɛte wɔ Chrome v32 na ɛmfa ho margin nhyehyɛe no, Chrome de viewport trɛw a ɛyɛ teateaa kɛse sen honam fam krataa kɛse no di dwuma bere a ɛresiesie media nsɛmmisa bere a ɔretintim wɛbsaet krataafa bi no. Eyi betumi ama Bootstrap no grid ketewaa a ɛboro so no ayɛ adwuma mpofirim bere a wɔretintim no. Hwɛ nsɛmma nhoma #12078 ne Chrome bɔne #273306 ma nsɛm bi. Nneɛma a wɔahyɛ ho nyansa sɛ wɔmfa nyɛ adwuma:
@screen-*
Less variables no botae ahorow no sɛnea ɛbɛyɛ a wobebu wo printa krataa no sɛ ɛsõ sen extra-small.Afei nso, sɛnea ɛte wɔ Safari v8.0 no, fixed-width .container
s betumi ama Safari de font kɛse ketewaa bi a ɛyɛ soronko adi dwuma bere a ɔretintim no. Hwɛ #14868 ne WebKit bug #138192 ma nsɛm pii. Ade biako a ebetumi ayɛ eyi ho adwuma ne sɛ wode CSS a edidi so yi bɛka ho:
Fi adaka no mu no, Android 4.1 (na ɛda adi sɛ nea wɔayi no adi foforo bi mpo) de Browser app no ba sɛ wɛbsaet browser a wɔpaw no dedaw (a ɛne Chrome bɔ abira). Awerɛhosɛm ne sɛ, Browser app no wɔ mfomso pii ne nea ɛne CSS nhyia wɔ ɔkwan a ɛkɔ akyiri so.
Wɔ <select>
elements so no, Android stock browser no renkyerɛ afã controls no sɛ ɛwɔ hɔ border-radius
ne/anaasɛ border
wɔde adi dwuma a. (Hwɛ StackOverflow asɛmmisa yi ma nsɛm no mu nsɛm.) Fa koodu no fã bi a ɛwɔ ase ha no yi CSS a ɛhyɛ abufuw no na kyerɛ ase <select>
sɛ ade a wɔanhyɛ da wɔ Android stock browser no so. Ɔdefo no agent sniffing kwati sɛ ɛbɛtwetwe Chrome, Safari, ne Mozilla browser ahorow no.
Wopɛ sɛ wuhu nhwɛso bi? Hwɛ JS Bin demo yi.
Sɛnea ɛbɛyɛ a wobenya osuahu a eye sen biara ama browser dedaw ne nea ɛyɛ bɔne no, Bootstrap de CSS browser hacks di dwuma wɔ mmeae pii de de wɔn ani si CSS soronko so wɔ browser ahorow bi so sɛnea ɛbɛyɛ a ɛbɛyɛ adwuma atwa mfomso ahorow a ɛwɔ browser ahorow no ankasa mu ho dwuma. Ntease wom sɛ saa hacks yi ma CSS validators nwiinwii sɛ ɛnyɛ adwuma. Wɔ mmeae awarefo bi no, yɛsan nso de bleeding-edge CSS features a wonnya nyɛɛ standardized koraa di dwuma, nanso wɔde eyinom di dwuma ma nkɔso a ɛkɔ so ara kwa.
Saa validation kɔkɔbɔ ahorow yi ho nhia wɔ nneyɛe mu efisɛ yɛn CSS no fã a ɛnyɛ hacky no yɛ validate koraa na hacky afã horow no nsiw ɔfã a ɛnyɛ hacky no dwumadi yiye no kwan, ɛno nti na yɛhyɛ da bu yɛn ani gu kɔkɔbɔ pɔtee yi so.
Yɛn HTML docs no nso wɔ HTML validation kɔkɔbɔ ahorow bi a ɛho nhia na ɛho nhia esiane sɛ yɛde adwuma bi a yɛde besiesie Firefox bɔne bi aka ho nti .
Bere a yɛmmoa obi foforo plugins anaa add-ons biara wɔ aban kwan so no, yɛde afotu bi a mfaso wɔ so ma a ɛbɛboa ma woakwati nsɛm a ebetumi aba wɔ wo nnwuma mu.
Ebinom a ɛto so abiɛsa softwea, a Google Maps ne Google Custom Search Engine ka ho, ne Bootstrap bɔ abira esiane * { box-sizing: border-box; }
, mmara a ɛma ɛyɛ saa padding
no nka element bi ntrɛwmu a etwa to a wɔabɔ ho akontaa no. Sua pii fa box model ne sizing ho wɔ CSS Tricks .
Ɛgyina nsɛm a ɛfa ho no so no, wubetumi abɔ so sɛnea ɛho hia (Ɔkwan 1) anaasɛ wobɛsan asiesie adaka no kɛse ama mpɔtam mũ no nyinaa (Ɔkwan 2).
Bootstrap di wɛb gyinapɛn ahorow a wɔtaa de di dwuma akyi na—a mmɔdenbɔ kakraa bi na ɛka ho—wobetumi de ayɛ wɛbsaet ahorow a wɔn a wɔde AT di dwuma no betumi akɔ so di dwuma no betumi akɔ so .
Sɛ wo navigation no kura links pii na ɛba ansa na nsɛm titiriw a ɛwɔ DOM no mu no aba a, fa Skip to main content
link bi ka ho ansa na navigation no aba (sɛ wopɛ nkyerɛkyerɛmu a ɛnyɛ den a, hwɛ A11Y Project asɛm yi a ɛfa skip navigation links ho ). Sɛ wode .sr-only
adesua no di dwuma a, ɛbɛma wɔde aniwa asie skip link no, na .sr-only-focusable
adesua no bɛhwɛ sɛ link no bɛyɛ nea wotumi hu bere a wɔde wɔn adwene asi so pɛn (ma keyboard a wɔde di dwuma a wohu ade).
Esiane sintɔ ahorow/mfomso ahorow a akyɛ wɔ Chrome mu (hwɛ nsɛmma nhoma 262171 wɔ Chromium bug tracker ) ne Internet Explorer (hwɛ asɛm yi a ɛfa in-page links ne focus order ho ), ɛho behia sɛ wohwɛ hu sɛ wo skip link no botae no anyɛ yiye koraa no, wotumi de wɔn adwene si nhyehyɛe so denam nneɛma a wɔde bɛka ho sotabindex="-1"
.
Bio nso, ebia wobɛpɛ sɛ wusiw adwene a wotumi hu a ɛkyerɛ sɛ wode w’adwene si biribi so wɔ botae no so no ano pefee (titiriw sɛnea Chrome mprempren nso de adwene si nneɛma so ne tabindex="-1"
bere a wode mouse no klik so) ne#content:focus { outline: none; }
.
Hyɛ no nsow sɛ saa bɔne yi nso bɛka nkitahodi foforo biara a ɛwɔ krataafa no mu a ebia wo wɛbsaet no de bedi dwuma no, na ɛbɛma mfaso biara nni so ama wɔn a wɔde keyboard di dwuma no. Wubetumi asusuw ho sɛ wode stop-gap fix a ɛte saa ara bɛka anchors afoforo a wɔato din / fragment identifiers a ɛyɛ adwuma sɛ link targets nyinaa ho.
Sɛ woreyɛ nesting headings ( <h1>
- <h6>
) a, ɛsɛ sɛ wo document header titiriw no yɛ <h1>
. Ɛsɛ sɛ nsɛmti a edi hɔ no de di dwuma wɔ ɔkwan a ntease wom so <h2>
- <h6>
sɛnea ɛbɛyɛ a screen akenkanfo betumi ayɛ nsɛm a wɔahyehyɛ ama wo nkratafa no.
Sua pii wɔ HTML CodeSniffer ne Penn State's AccessAbility .
Mprempren, kɔla ahorow a wɔaka abom a wɔahyɛ da ayɛ a ɛwɔ Bootstrap mu no bi (te sɛ bɔtn adesua ahorow a wɔayɛ no sɛnea wɔyɛ no, kɔla ahorow a ɛtwe adwene si koodu so no bi a wɔde di dwuma ma mfitiase koodu blocks , nsɛm a .bg-primary
ɛfa akyi boafo adesuakuw no, ne link kɔla a wɔahyɛ da ayɛ bere a wɔde di dwuma wɔ akyi fitaa so) wɔ nsonsonoe a ɛba fam (a ɛba fam sen dodow a wɔkamfo kyerɛ sɛ ɛyɛ 4.5:1 ). Eyi betumi de ɔhaw aba wɔn a wɔde di dwuma a wɔn ani nhu ade yiye anaasɛ wɔn ani afura wɔ kɔla ho no so. Ebia ɛho behia sɛ wɔyɛ nsakrae wɔ kɔla ahorow a wɔahyɛ da ayɛ yi mu na ama nsonsonoe ne akenkan no ayɛ kɛse.
Bootstrap no wɔayi no adi wɔ MIT tumi krataa ase na ɛyɛ copyright 2016 Twitter. Sɛ wɔnoa no ma ɛyɛ nketenkete a, wobetumi de tebea horow a edidi so yi akyerɛkyerɛ mu.
Bootstrap tumi krataa no nyinaa wɔ adwuma no akorae no mu ma nsɛm pii.
Mpɔtam hɔfoɔ akyerɛ Bootstrap nkrataa ase akɔ kasa ahodoɔ mu. Obiara nni hɔ a aban ntumi mmoa na ebia ɛnyɛ bere nyinaa na ɛyɛ nea ɛwɔ hɔ nnɛ.
Yɛnmmoa nhyehyɛ anaa yɛmfa nkyerɛase ahorow nhyɛ mu, yɛde link kɔ wɔn so kɛkɛ.
Woawie nkyerɛase foforo anaa nea eye sen saa? Bue twe adesrɛ bi na fa ka yɛn list no ho.