Odniesienie do obrazów Bootstrap CSS
Obrazy Bootstrapa
Zaokrąglone rogi:
Koło:
Miniaturka:
<img> Klasy
Poniższe klasy mogą być użyte do stylizacji dowolnego obrazu:
Class | Description | Example |
---|---|---|
.img-rounded | Adds rounded corners to an image (not available in IE8) | |
.img-circle | Shapes the image to a circle (not available in IE8) | |
.img-thumbnail | Shapes the image to a thumbnail | |
.img-responsive | Makes an image responsive (will scale nicely to the parent element) |
Responsywne obrazy
Twórz responsywne obrazy, dodając .img-responsive
klasę do <img>
tagu. Obraz będzie wtedy ładnie skalowany do elementu nadrzędnego.
Klasa .img-responsive
dotyczy max-width: 100%
, height: auto
, i display:block
do obrazu:
Przykład
<img src="cinqueterre.jpg" class="img-responsive" alt="Cinque Terre">