CSS -grensbreedte
CSS-grensbreedte
Die border-width
eiendom spesifiseer die breedte van die vier grense.
Die breedte kan gestel word as 'n spesifieke grootte (in px, pt, cm, em, ens.) of deur een van die drie vooraf gedefinieerde waardes te gebruik: dun, medium of dik:
Voorbeeld
Demonstrasie van die verskillende grenswydtes:
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
Spesifieke sybreedtes
Die border-width
eiendom kan van een tot vier waardes hê (vir die boonste rand, regterrand, onderrand en die 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 */
}