CSS -Konturversatz
CSS-Konturversatz
Die outline-offset
Eigenschaft fügt einen Abstand zwischen einem Umriss und dem Rand/Rand eines Elements hinzu. Der Raum zwischen einem Element und seinem Umriss ist transparent.
Das folgende Beispiel gibt einen Umriss an, der 15 Pixel außerhalb der Rahmenkante liegt:
Dieser Absatz hat einen Umriss von 15 Pixel außerhalb der Begrenzungskante.
Beispiel
p {
margin: 30px;
border: 1px solid black;
outline:
1px solid red;
outline-offset: 15px;
}
Das folgende Beispiel zeigt, dass der Raum zwischen einem Element und seinem Umriss transparent ist:
Dieser Absatz hat einen Umriss von 15px außerhalb des Randes.
Beispiel
p {
margin: 30px;
background:
yellow;
border: 1px solid black;
outline:
1px solid red;
outline-offset: 15px;
}
Alle CSS-Gliederungseigenschaften
Property | Description |
---|---|
outline | A shorthand property for setting outline-width, outline-style, and outline-color in one declaration |
outline-color | Sets the color of an outline |
outline-offset | Specifies the space between an outline and the edge or border of an element |
outline-style | Sets the style of an outline |
outline-width | Sets the width of an outline |