Properti gaya melimpah
Contoh
Gunakan properti overflow untuk menggulir konten yang meluap:
document.getElementById("myDIV").style.overflow = "scroll";
Definisi dan Penggunaan
Properti overflow mengatur atau mengembalikan apa yang harus dilakukan dengan konten yang dirender di luar kotak elemen.
Tip: Jika Anda ingin menyembunyikan scrollbar seluruh dokumen, gunakan properti overflow pada isi atau elemen html.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
overflow | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti overflow:
object.style.overflow
Setel properti overflow:
object.style.overflow = "visible|hidden|scroll|auto|initial|inherit"
Nilai properti
Value | Description |
---|---|
visible | Content is NOT clipped and may be shown outside the element box. This is default |
hidden | Content outside the element box is not shown |
scroll | Scroll bars are added, and content is clipped when necessary |
auto | Content is clipped and scroll bars are added when necessary |
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: | terlihat |
---|---|
Nilai Kembali: | Sebuah String, mewakili konten yang dirender di luar kotak elemen |
Versi CSS | CSS2 |
Lebih Banyak Contoh
Contoh
Gunakan properti overflow untuk menyembunyikan konten yang meluap:
document.getElementById("myDiv").style.overflow = "hidden";
Contoh
Kembalikan properti overflow:
alert(document.getElementById("myDiv").style.overflow);
Halaman Terkait
Tutorial CSS: CSS Overflow
Tutorial CSS: Pemosisian CSS
Referensi CSS: properti overflow
Objek Gaya