Background Style

BY IN HTML Comments Off on Background Style

Dengan menggunakan CSS, kita dapat membuat variasi background untuk interface halaman web kita. Berikut ini adalah contoh2nya:

Mendefinisikan background dengan warna kuning

p { background-color: yellow; }

Menggunakan image untuk background halaman

body
{
background-image: url(“gambar.jpg”)
}

Membuat watermark (jika discroll, gambar tidak akan bergerak)

body
{
background-image: url(“gambar.jpg”);
background-attachment: fixed
}

Mengulang gambar ke samping

body
{
background-image: url(“gambar.jpg”);
background-repeat: repeat-x;
}

Mengulang gambar ke bawah

body
{
background-image: url(“gambar.jpg”);
background-repeat: repeat-y;
}

Meletakkan background pada posisi tertentu

body
{
background-image: url(“teepees.jpg”);
background-repeat: no-repeat;
background-position: 100px 50px
}

body
{
background-image: url(“teepees.jpg”);
background-repeat: no-repeat;
background-position: 50% 50%
}




Comments are closed.