Lebar Border CSS
- Hal Sebelumnya Garis Border CSS
- Hal Berikutnya Warna Border CSS
Lebar Border CSS
border-width
Atribut menentukan lebar empat garis batas.
Lebar dapat diatur menjadi ukuran khusus (dengan px, pt, cm, em), atau menggunakan salah satu dari tiga nilai pradefinisi berikut: thin, sedang, atau tebal:
Contoh
Demosikan berbagai lebar garis batas:
p.one { border-style: solid; border-width: 5px; } p.two { border-style: solid; border-width: sedang; } p.three { border-style: dotted; border-width: 2px; } p.four { border-style: dotted; border-width: tebal; }
Hasil:
5px border-width
sedang border-width
2px border-width
tebal border-width
Lebar sisi tertentu
border-width
Properti dapat diset ke satu hingga empat nilai (digunakan untuk atas, kanan, bawah, dan kiri):
Contoh
p.one { border-style: solid; border-width: 5px 20px; /* Atas dan Bawah 5px, Lainnya 20px */ } p.two { border-style: solid; border-width: 20px 5px; /* Atas dan Bawah 20px, Lainnya 5px */ } p.three { border-style: solid; border-width: 25px 10px 4px 35px; /* Atas 25px, Kanan 10px, Bawah 4px, Kiri 35px */ }
- Hal Sebelumnya Garis Border CSS
- Hal Berikutnya Warna Border CSS