Odniesienie do obrazów Bootstrap CSS


Obrazy Bootstrapa

Zaokrąglone rogi:

Pięć krain

Koło:

Pięć krain

Miniaturka:

Pięć krain

<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-responsiveklasę do <img>tagu. Obraz będzie wtedy ładnie skalowany do elementu nadrzędnego.

Klasa .img-responsivedotyczy max-width: 100%, height: auto, i display:blockdo obrazu:

Przykład

<img src="cinqueterre.jpg" class="img-responsive" alt="Cinque Terre">