Background Position

Properti CSS background-position

Menentukan posisi latar belakang gambar (image)

<!-- kode elemen -->
<div>
 <p></p>
</div>
<!-- style CSS -->
<style>
div {
    background-image: url(https://i.ibb.co/YWZJQVZ/bgmini.webp);
    background-repeat: no-repeat;
    background-size: value; /* Lihat contoh untuk menentukan nilai value */
}
</style>

Dibawah ini tampilan untuk masing-masing value dari propery background-position:, value =

  1. top (top center)

  2. center (center center)

  3. bottom (bottom center)

  4. right (right top)

  5. left (left top)

  6. right center

  7. left center

  8. right bottom

  9. left bottom

Komentar