Lebar Batas CSS
Lebar Batas CSS
Properti border-width
menentukan lebar dari empat perbatasan.
Lebar dapat diatur sebagai ukuran tertentu (dalam px, pt, cm, em, dll) atau dengan menggunakan salah satu dari tiga nilai yang telah ditentukan sebelumnya: tipis, sedang, atau tebal:
Contoh
Demonstrasi lebar perbatasan yang berbeda:
p.one
{
border-style: solid;
border-width: 5px;
}
p.two
{
border-style: solid;
border-width: medium;
}
p.three
{
border-style: dotted;
border-width: 2px;
}
p.four
{
border-style: dotted;
border-width: thick;
}
Hasil:
5px border-width
medium border-width
2px border-width
thick border-width
Lebar Sisi Spesifik
Properti border-width
dapat memiliki satu hingga empat nilai (untuk batas atas, batas kanan, batas bawah, dan batas kiri):
Contoh
p.one {
border-style: solid;
border-width: 5px 20px; /*
5px top and bottom, 20px on the sides */
}
p.two {
border-style:
solid;
border-width: 20px 5px; /* 20px top and bottom, 5px on the
sides */
}
p.three {
border-style: solid;
border-width: 25px 10px
4px 35px; /* 25px top, 10px right, 4px bottom and 35px left */
}