Referensi Gambar Bootstrap CSS
Gambar Bootstrap
Sudut Bulat:
Lingkaran:
Gambar kecil:
<img> Kelas
Kelas di bawah ini dapat digunakan untuk menata gambar apa pun:
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) |
Gambar Responsif
Buat gambar responsif dengan menambahkan .img-responsive
kelas ke <img>
tag. Gambar kemudian akan diskalakan dengan baik ke elemen induk.
Kelas .img-responsive
berlaku max-width: 100%
, height: auto
, dan display:block
ke gambar:
Contoh
<img src="cinqueterre.jpg" class="img-responsive" alt="Cinque Terre">