Cara - Mengubah Warna Peluru Daftar
Pelajari cara mengubah warna poin untuk daftar dengan CSS.
Ubah Warna Peluru
- Adele
- agnes
- Billy
- Bob
Langkah 1) Tambahkan HTML:
Buat daftar dasar:
Contoh
<ul>
<li>Adele</li>
<li>Agnes</li>
<li>Billy</li>
<li>Bob</li>
</ul>
Langkah 2) Tambahkan CSS:
Secara default, tidak mungkin untuk mengubah warna poin item daftar. Namun, Anda dapat melakukan beberapa trik CSS untuk memungkinkannya. Perhatikan bahwa Anda mungkin harus mengubahnya sedikit berbeda jika Anda menggunakan kerangka kerja CSS atau lembar gaya khusus:
Contoh
ul {
list-style: none; /* Remove default bullets */
}
ul li::before {
content: "\2022"; /* Add content: \2022 is the CSS Code/unicode for a
bullet */
color: red; /* Change the color */
font-weight:
bold; /* If you want it to be bold */
display: inline-block; /*
Needed to add space between the bullet and the text */
width: 1em;
/* Also needed for space (tweak if needed) */
margin-left: -1em; /*
Also needed for space (tweak if needed) */
}