Kamis, 05 Maret 2020

CSS #5 Background

Background

1. background-color, mengatur warna pada background.

contoh:
          body {
                    background-color: lightblue;
                   }

2. background-image, mengatur gambar yang akan digunakan pada background.

contoh:

          body {
                    background-image: url( folder/nama file.jpg;
                   }
untuk mencari gambar yang berpola bisa kunjungi website, subtlepatterns.com

3. background-position, mengatur posisi gambar pada background.

contoh:

ada bantak valuenya:

Ada top left, center, right, center left, center center, center right, bottom left, bottom center, bottom right, x% y%, x pos y pos.

           body {
                    background-color: lightblue;
                    background-repeat: repeat-x; <!--bisa pilih x/y atau no-repeat-->
                    background-image: url( folder/nama file.jpg;
                    background-position: top center;
         
4. background-repeat, mengatur jenis pengulangan pada background.

contoh:
         
            body {
                    background-color: lightblue;
                    background-repeat: repeat-x; <!--bisa pilih x/y atau no-repeat-->
                    background-image: url( folder/nama file.jpg;
                    }

5. background.

atau semuanya bisa disingkat menjadi:

body {
          background: lightgreen url(nama file.jpg) top-left no repeat ;
          }

Tidak ada komentar:

Posting Komentar