Hoʻokumu ʻia nā ʻāpana he nui i hiki ke hoʻohana hou ʻia i Bootstrap e hāʻawi i ka hoʻokele, nā mākaʻikaʻi, nā popovers, a me nā mea hou aku.
ʻO ka pagination maʻalahi a me ka liʻiliʻi i hoʻoikaika ʻia e Rdio, maikaʻi no nā noi a me nā hopena ʻimi. ʻO ka poloka nui he paʻakikī ke hala, hiki ke hoʻonui ʻia, a hāʻawi i nā wahi kaomi nui.
Hiki ke hoʻopilikino ʻia nā loulou a hana i kekahi mau kūlana me ka papa kūpono. .disabled
no nā loulou unclickable a .active
no ka ʻaoʻao o kēia manawa.
E hoʻohui i kekahi o nā papa koho ʻelua e hoʻololi i ka alignment o nā loulou pagination: .pagination-centered
a .pagination-right
.
Hiki ke maʻalahi ka ʻāpana pagination paʻamau a hana i nā ʻano like ʻole.
Hoʻopili ʻia i kahi <div>
, ʻo ka pagination he <ul>
.
- <div class = "ka helu helu" >
- <ul>
- <li><a href = "#" > Mamua </a></li>
- <li class = "ʻoihana" >
- <a href = "#" > 1 </a>
- </li>
- <li><a href = "#" > 2 </a></li>
- <li><a href = "#" > 3 </a></li>
- <li><a href = "#" > 4 </a></li>
- <li><a href = "#" > Aʻe </a></li>
- </ul>
- </div>
ʻO ka ʻāpana pager he pūʻulu o nā loulou no ka hoʻokō ʻana i ka pagination maʻalahi me ka māka māmā a me nā ʻano māmā. He mea maikaʻi ia no nā pūnaewele maʻalahi e like me nā blog a i ʻole nā makasina.
Hoʻohana pū nā loulou Pager i ka .disabled
papa maʻamau mai ka pagination.
Ma ka maʻamau, hoʻonohonoho ka pager i nā loulou.
- <ul class = "pager" >
- <li>
- <a href = "#" > Mua </a>
- </li>
- <li>
- <a href = "#" > Aʻe </a>
- </li>
- </ul>
Lepili | Markup |
---|---|
Default | <span class="label">Default</span> |
Pōmaikaʻi | <span class="label label-success">Success</span> |
ʻŌlelo aʻo | <span class="label label-warning">Warning</span> |
Mea nui | <span class="label label-important">Important</span> |
ʻIke | <span class="label label-info">Info</span> |
Hoʻololi | <span class="label label-inverse">Inverse</span> |
He ʻano liʻiliʻi a maʻalahi nā pahu no ka hōʻike ʻana i kahi hōʻailona a i ʻole helu o kekahi ʻano. Loaʻa pinepine ʻia lākou ma nā mea leka uila e like me Mail.app a i ʻole ma nā polokalamu kelepona no ka hoʻolaha ʻana.
inoa | Laʻana | Markup |
---|---|---|
Default | 1 | <span class="badge">1</span> |
Pōmaikaʻi | 2 | <span class="badge badge-success">2</span> |
ʻŌlelo aʻo | 4 | <span class="badge badge-warning">4</span> |
Mea nui | 6 | <span class="badge badge-important">6</span> |
ʻIke | 8 | <span class="badge badge-info">8</span> |
Hoʻololi | 10 | <span class="badge badge-inverse">10</span> |
Hāʻawi ʻo Bootstrap i kahi ʻāpana māmā a maʻalahi i kapa ʻia he pūʻulu koa e hōʻike i ka ʻike ma kāu pūnaewele. He hana maikaʻi ia ma nā kahua kūʻai a me nā ʻike-kaumaha.
E kāʻei i kāu ʻike ma ke div
ʻano penei:
- <div class = "hui meʻe" >
- <h1> Poʻomanaʻo </h1>
- <p> Lepe inoa </p>
- <p>
- <a papa = "btn btn-kumu btn-nui" >
- Aʻo hou mai
- </a>
- </p>
- </div>
He pūʻali koa maʻalahi kēia, he ʻano ʻano jumbotron maʻalahi no ke kāhea ʻana i ka nānā hou aku i nā ʻike i hōʻike ʻia.
He pūpū maʻalahi no ka h1
hoʻokaʻawale ʻana i nā ʻāpana o ka ʻikepili ma kahi ʻaoʻao. Hiki iā ia ke hoʻohana i ka h1
' default small
, element a me ka hapa nui o nā mea ʻē aʻe (me nā ʻano ʻē aʻe).
- <div class = "page-header" >
- <h1> Ke poʻo ʻaoʻao laʻana </h1>
- </div>
Ma ka paʻamau, ua hoʻolālā ʻia nā kiʻi liʻiliʻi o Bootstrap e hōʻike i nā kiʻi i hoʻopili ʻia me ka hōʻailona liʻiliʻi.
Me kahi hōʻailona ʻokoʻa, hiki ke hoʻohui i nā ʻano HTML like ʻole e like me nā poʻo, nā paukū, a i ʻole nā pihi i loko o nā kiʻi liʻiliʻi.
He mea maikaʻi nā kiʻi liʻiliʻi (ma mua .media-grid
a hiki i ka v1.4) no nā pahu kiʻi a i ʻole wikiō, nā hopena huli kiʻi, nā huahana kūʻai aku, nā portfolios, a me nā mea hou aku. Hiki iā lākou ke loulou a i ʻole maʻiʻo static.
He mea maʻalahi ka hōʻailona kiʻi liʻiliʻi—ʻo ul
ia li
wale nō ka mea e pono ai. He mea maʻalahi hoʻi ia, e ʻae ana i kēlā me kēia ʻano maʻiʻo me kahi markup hou aʻe e kāʻei i kāu ʻike.
ʻO ka mea hope, hoʻohana ka ʻāpana kiʻi liʻiliʻi i nā papa ʻōnaehana grid i loaʻa-like .span2
a i ʻole .span3
-no ka hoʻomalu ʻana i nā ana liʻiliʻi liʻiliʻi.
E like me ka mea i ʻōlelo ʻia ma mua, ʻo ka markup i koi ʻia no nā thumbnails he māmā a pololei. Eia ka nānā ʻana i ka hoʻonohonoho paʻamau no nā kiʻi i hoʻopili ʻia :
- <ul class = "thumbnails" >
- <li class = "span3" >
- <a href = "#" class = "thumbnail" >
- <img src = "https://placehold.it/260x180" alt = "" >
- </a>
- </li>
- ...
- </ul>
No ka maʻiʻo HTML maʻamau i nā kiʻi liʻiliʻi, hoʻololi iki ka markup. No ka ʻae ʻana i ka maʻiʻo pae poloka ma nā wahi āpau, hoʻololi mākou i ka <a>
mea <div>
like me:
- <ul class = "thumbnails" >
- <li class = "span3" >
- <div class = "thumbnail" >
- <img src = "https://placehold.it/260x180" alt = "" >
- <h5> Lepili liʻiliʻi liʻiliʻi < /h5>
- <p> Ke kiʻi kiʻi liʻiliʻi ma ʻaneʻi... </p>
- </div>
- </li>
- ...
- </ul>
Me Bootstrap 2, ua maʻalahi mākou i ka papa kumu: .alert
ma kahi o .alert-message
. Ua hōʻemi pū mākou i ka māka liʻiliʻi i koi ʻia - ʻaʻole <p>
koi ʻia ma ka paʻamau, ʻo ka waho wale nō <div>
.
No ka mea ʻoi aku ka lōʻihi me ka liʻiliʻi o nā code, ua wehe mākou i ka nānā ʻokoʻa no nā makaʻala poloka, nā memo i hele mai me ka padding a me nā kikokikona maʻamau. Ua loli ka papa i .alert-block
.
Hele mai ʻo Bootstrap me kahi plugin jQuery nui e kākoʻo ana i nā memo makaʻala, e hoʻokuʻu iā lākou me ka wikiwiki a me ka maʻalahi.
E kāʻei i kāu memo a me kahi ikona pani koho i loko o kahi div me ka papa maʻalahi.
- <div class = "makaʻala" >
- <pāpā pihi = " pani" data-dismiss = "makaʻala" > × </ pihi>
- <strong> 'Ōlelo Aʻo! </strong> ʻO ka nānā maikaʻi loa iā ʻoe iho, ʻaʻole ʻoe maikaʻi loa.
- </div>
Nā poʻo i luna! Pono nā polokalamu iOS href="#"
no ka hoʻokuʻu ʻana i nā makaʻala. E ʻoluʻolu e hoʻokomo iā ia a me ke ʻano ʻikepili no nā kiʻi kokoke i heleuma. ʻO kahi ʻē aʻe, hiki iā ʻoe ke hoʻohana i kahi <button>
mea me ka ʻikepili ʻikepili, a mākou i koho ai e hana no kā mākou mau palapala. I ka hoʻohana ʻana iā <button>
, pono ʻoe e hoʻokomo type="button"
a i ʻole e waiho ʻia kāu mau palapala.
E hoʻonui maʻalahi i ka memo makaʻala maʻamau me nā papa koho ʻelua: .alert-block
no ka hoʻopaʻa ʻana a me nā mana kikokikona a .alert-heading
no kahi poʻomanaʻo like.
ʻO ka nānā maikaʻi iā ʻoe iho, ʻaʻole maikaʻi ʻoe. Nulla vitae elit libero, a pharetra augue. ʻO ka hoʻomaka ʻana o ka cursus magna, vel scelerisque nisl consectetur et.
- <div class = "pākaʻi makaʻala" >
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
- <h4 class = "alert-heading" > ' Ōlelo Aʻo! </h4>
- ʻO ka nānā maikaʻi loa iā ʻoe iho, ʻaʻole ʻoe ...
- </div>
- <div class = "alaala-hewa" >
- ...
- </div>
- <div class = "alaala-kūpono" >
- ...
- </div>
- <div class = "ʻike makaʻala makaʻala" >
- ...
- </div>
Paʻamau pae holomua me ka gradient kū pololei.
- <div class = "holomua" >
- <div class = "pā"
- style = " laula : 60 %; " ></div>
- </div>
E hoʻohana i kahi gradient e hana i kahi hopena kaha (ʻaʻohe IE).
- <div class = "holoi holomua holomua" >
- <div class = "pā"
- style = " laula : 20 %; " ></div>
- </div>
Lawe i ka laʻana kaha ʻoniʻoni a hoʻolalelale iā ia (ʻaʻohe IE).
- <div class = "holoi holomua holomua
- hana " >
- <div class = "pā"
- style = " laula : 40 %; " ></div>
- </div>
Hoʻohana nā pahu holomua i kekahi o nā pihi like a me nā papa makaʻala no nā ʻano like.
E like me nā waihoʻoluʻu paʻa, loaʻa iā mākou nā ʻāpana holomua ʻokoʻa.
Hoʻohana nā pā holomua i nā hoʻololi CSS3, no laila inā hoʻololi ʻoe i ka laulā ma o javascript, e hoʻololi ʻia ka nui.
Inā ʻoe e hoʻohana i ka .active
papa, e hoʻolalelale kāu mau .progress-striped
kaola holomua i nā kaha mai ka hema a i ka ʻākau.
Hoʻohana nā pā holomua i nā gradient CSS3, nā hoʻololi, a me nā animation e hoʻokō i kā lākou hopena āpau. ʻAʻole kākoʻo ʻia kēia mau hiʻohiʻona ma IE7-9 a i ʻole nā mana kahiko o Firefox.
ʻAʻole kākoʻo ʻo Opera a me IE i nā animation i kēia manawa.
E hoʻohana i ka pūnāwai ma ke ʻano he hopena maʻalahi i kahi mea e hāʻawi ai i kahi hopena inset.
- <div class = "maikaʻi" >
- ...
- </div>
E hoʻohana i ka hōʻailona kokoke maʻamau no ka hoʻokuʻu ʻana i nā ʻike e like me nā modals a me nā makaʻala.
- <pāpā pihi = " kokoke" > &manawa; </ pihi>
Pono nā polokalamu iOS i kahi href="#" no nā hanana kaomi inā makemake ʻoe e hoʻohana i kahi heleuma.
- <a papa = "kokoke" href = "#" > &manawa; </a>