Breedte CSS- rand
Breedte CSS-rand
De border-width
eigenschap specificeert de breedte van de vier randen.
De breedte kan worden ingesteld als een specifieke grootte (in px, pt, cm, em, enz.) of door een van de drie vooraf gedefinieerde waarden te gebruiken: dun, medium of dik:
Voorbeeld
Demonstratie van de verschillende randbreedtes:
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;
}
Resultaat:
5px border-width
medium border-width
2px border-width
thick border-width
Specifieke zijbreedtes
De border-width
eigenschap kan één tot vier waarden hebben (voor de bovenrand, rechterrand, onderrand en linkerrand):
Voorbeeld
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 */
}