Properti CSS border-top-width
Contoh
Tetapkan lebar untuk batas atas:
div {border-top-width: thin;}
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Properti border-top-width
menetapkan lebar batas atas elemen.
Catatan: Selalu deklarasikan properti border-style atau
border-top-style sebelum border-top-width
properti. Sebuah elemen harus memiliki batas sebelum Anda dapat mengubah lebarnya.
Nilai bawaan: | sedang |
---|---|
Diwarisi: | tidak |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.borderTopWidth="5px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
border-top-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintaks CSS
border-top-width: medium|thin|thick|length|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
medium | Specifies a medium top border. This is default | |
thin | Specifies a thin top border | |
thick | Specifies a thick top border | |
length | Allows you to define the thickness of the top border. Read about length units | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Lebih Banyak Contoh
Contoh
Atur lebar batas atas menjadi sedang:
div {border-top-width: medium;}
Contoh
Atur lebar batas atas menjadi tebal:
div {border-top-width: thick;}
Contoh
Atur lebar batas atas menjadi 1px:
div {border-top-width: 1px;}
Contoh
Atur lebar batas atas menjadi 15px:
div {border-top-width: 15px;}
Halaman Terkait
Tutorial CSS: Perbatasan CSS
Referensi CSS: properti border-top
Referensi DOM HTML: properti borderTopWidth