Lebar Batas CSS
- 上一页 Batas CSS
- 下一页 Warna Batas CSS
Lebar Batas CSS
border-width
Atribut menentukan lebar empat garisan.
Lebar dapat ditetapkan kepada saiz khusus (dengan px, pt, cm, em) atau menggunakan salah satu daripada tiga nilai pradefinisi berikut: nipis, sedang atau tebal:
实例
Paparkan lebar garisan berbeza:
p.one { border-style: solid; border-width: 5px; } p.two { border-style: solid; border-width: sedang; } p.three { border-style: titik; border-width: 2px; } p.four { border-style: titik; border-width: tebal; }
Hasil:
5px border-width
sedang border-width
2px border-width
tebal border-width
特定边的宽度
border-width
属性可以设置一到四个值(用于上边框、右边框、下边框和左边框):
实例
p.one { border-style: solid; border-width: 5px 20px; /* 上边框和下边框为 5px,其他边为 20px */ } p.two { border-style: solid; border-width: 20px 5px; /* 上边框和下边框为 20px,其他边为 5px */ } p.three { border-style: solid; border-width: 25px 10px 4px 35px; /* 上边框 25px,右边框 10px,下边框 4px,左边框 35px */ }
- 上一页 Batas CSS
- 下一页 Warna Batas CSS