Home » CSS » Outline Shorthand di CSS: Code dan Sintaknya

Outline Shorthand di CSS: Code dan Sintaknya

by Hanifah Nurbaeti
by Hanifah Nurbaeti

CSS Outline – Properti Shorthand

Properti outline adalah properti singkatan untuk menyetel properti outline individual berikut:

  • outline-width
  • outline-style (required)
  • outline-color

Properti outline ditentukan sebagai satu, dua, atau tiga nilai dari daftar di atas. Urutan nilainya tidak penting.

Contoh :

<!DOCTYPE html>
<html>
<head>
<style>
p.ex1 {outline: dashed;}
p.ex2 {outline: dotted red;}
p.ex3 {outline: 5px solid yellow;}
p.ex4 {outline: thick ridge pink;}
</style>
</head>
<body>

<h2> Properti garis besar </h2>

<p class = "ex1"> Garis putus-putus. </p>
<p class = "ex2"> Garis merah putus-putus. </p>
<p class = "ex3"> Garis besar kuning solid 5px. </p>
<p class = "ex4"> Garis tepi tebal berwarna merah muda. </p>

</body>
</html>

You may also like