CSS -Rahmenbreite
CSS-Rahmenbreite
Die border-width
Eigenschaft gibt die Breite der vier Rahmen an.
Die Breite kann als spezifische Größe (in px, pt, cm, em usw.) oder durch Verwendung eines der drei vordefinierten Werte eingestellt werden: dünn, mittel oder dick:
Beispiel
Demonstration der verschiedenen Randbreiten:
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;
}
Ergebnis:
5px border-width
medium border-width
2px border-width
thick border-width
Spezifische Seitenbreiten
Die border-width
Eigenschaft kann einen bis vier Werte haben (für den oberen Rand, den rechten Rand, den unteren Rand und den linken Rand):
Beispiel
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 */
}