Gaya properti yang jelas
Contoh
Melarang objek mengambang di sisi kiri teks dalam sebuah elemen:
document.getElementById("demo").style.clear = "left";
Definisi dan Penggunaan
Properti clear menetapkan atau mengembalikan posisi elemen relatif terhadap objek mengambang.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti yang jelas:
object.style.clear
Setel properti yang jelas:
object.style.clear = "none|left|right|both|initial|inherit"
Nilai properti
Value | Description |
---|---|
none | Allows floating objects on both sides of the element. This is default |
left | No floating objects allowed on the left side of the element |
right | No floating objects allowed on the right side of the element |
both | No floating objects allowed on either the left or right side of the element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detail Teknis
Nilai Bawaan: | tidak ada |
---|---|
Nilai Kembali: | Sebuah String, mewakili posisi elemen relatif terhadap objek mengambang |
Versi CSS | CSS1 |
Lebih Banyak Contoh
Contoh
Kembalikan properti yang jelas:
alert(document.getElementById("demo").style.clear);
Halaman Terkait
Tutorial CSS: Float CSS
Referensi CSS: hapus properti
Objek Gaya