Posted by : Unknown Minggu, 12 Oktober 2014

CSS background-image Properti


Contoh

Mengatur background-image untuk <body> elemen:
body {
    background-image: url('paper.gif');
    background-color: #cccccc;
}

Coba sendiri »
Lebih "Coba Sendiri" contoh di bawah.

Definisi dan Penggunaan

Properti background-image set satu atau beberapa gambar latar belakang untuk elemen.
Latar belakang dari suatu unsur adalah ukuran total elemen, termasuk padding dan perbatasan (tapi tidak margin).
Secara default, latar belakang-gambar ditempatkan di sudut kiri atas elemen, dan diulang secara vertikal dan horizontal.
Tip: Selalu mengatur latar belakang warna yang akan digunakan jika gambar tidak tersedia.
Nilai default: none
Warisan: tidak ada
Animatable: no. Baca tentang animatable
Versi: CSS1
JavaScript sintaks: objek .style.backgroundImage = "url (smiley.gif)" Cobalah


Dukungan Browser

Angka-angka dalam tabel menentukan versi browser pertama yang mendukung penuh properti.
Property




background-image 1.0 4.0 1.0 1.0  3.5
Catatan: IE8 dan sebelumnya tidak mendukung beberapa gambar latar belakang pada satu elemen.

CSS Sintaks

background-image: url |none|initial|inherit;

Nilai Properti

Value Description
url(' URL ') The URL to the image. To specify more than one image, separate the URLs with a comma
none No background image will be displayed. This is default
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit


Contoh

Contoh Lebih

Contoh

Set beberapa gambar latar belakang untuk <body> elemen:
body {
    background-image: url("img_tree.gif"), url("img_flwr.gif");
    background-color: #cccccc;
}

Coba sendiri »

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © 2014 MAKALAH PHP (PEMOGRAMANWEB) - Powered by Blogger - Original Template By Johanes Djogan - Design By Mulyana Siratu Selvie Joelexx - Some Right Is Reserved -