Nā kiʻi
Nā palapala a me nā laʻana no ke koho ʻana i nā kiʻi i ke ʻano pane (no laila ʻaʻole lākou e ʻoi aku ka laulā ma mua o ko lākou makua) a hoʻohui i nā ʻano māmā iā lākou-ma nā papa āpau.
Nā kiʻi pane
Hoʻopili ʻia nā kiʻi ma Bootstrap me .img-fluid
. Pili kēia max-width: 100%;
a height: auto;
me ke kiʻi i mea unahi me ka laula makua.
<img src="..." class="img-fluid" alt="...">
Nā kiʻi liʻiliʻi kiʻi
Ma waho aʻe o kā mākou mau pono palena-radius , hiki iā ʻoe ke hoʻohana .img-thumbnail
e hāʻawi i kahi kiʻi i kahi hiʻohiʻona pōʻai palena 1px.
<img src="..." class="img-thumbnail" alt="...">
Hoʻopololei i nā kiʻi
Hoʻopololei i nā kiʻi me nā papa lana kōkua a i ʻole nā papa hoʻoponopono kikokikona . block
Hiki ke hoʻohālikelike ʻia nā kiʻi pae me ka hoʻohana ʻana i ka .mx-auto
papa hana margin .
<img src="..." class="rounded float-start" alt="...">
<img src="..." class="rounded float-end" alt="...">
<img src="..." class="rounded mx-auto d-block" alt="...">
<div class="text-center">
<img src="..." class="rounded" alt="...">
</div>
Kiʻi
Inā ʻoe e hoʻohana ana i ka <picture>
mea e wehewehe i nā <source>
mea he nui no kahi kikoʻī <img>
, e hōʻoia e hoʻohui i nā .img-*
papa i ka <img>
a ʻaʻole i ka <picture>
tag.
<picture>
<source srcset="..." type="image/svg+xml">
<img src="..." class="img-fluid img-thumbnail" alt="...">
</picture>
Sass
Nā mea hoʻololi
Loaʻa nā ʻokoʻa no nā liʻiliʻi kiʻi.
$thumbnail-padding: .25rem;
$thumbnail-bg: $body-bg;
$thumbnail-border-width: $border-width;
$thumbnail-border-color: $gray-300;
$thumbnail-border-radius: $border-radius;
$thumbnail-box-shadow: $box-shadow-sm;