Offset Garis Besar CSS
Offset Garis Besar CSS
Properti outline-offset
menambahkan ruang antara garis dan tepi/batas elemen. Ruang antara elemen dan garis besarnya transparan.
Contoh berikut menentukan garis luar 15px di luar tepi perbatasan:
Paragraf ini memiliki garis tepi 15px di luar tepi tepi.
Contoh
p {
margin: 30px;
border: 1px solid black;
outline:
1px solid red;
outline-offset: 15px;
}
Contoh berikut menunjukkan bahwa ruang antara elemen dan kerangkanya transparan:
Paragraf ini memiliki garis luar 15px di luar tepi perbatasan.
Contoh
p {
margin: 30px;
background:
yellow;
border: 1px solid black;
outline:
1px solid red;
outline-offset: 15px;
}
Semua Properti Garis CSS
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 |