Jak to zrobić — zmienić kolor punktora list
Dowiedz się, jak zmienić kolory punktorów dla list z CSS.
Zmień kolor punktora
- Adele
- Agnieszka
- Menażka
- Pion
Krok 1) Dodaj kod HTML:
Utwórz listę podstawową:
Przykład
<ul>
<li>Adele</li>
<li>Agnes</li>
<li>Billy</li>
<li>Bob</li>
</ul>
Krok 2) Dodaj CSS:
Domyślnie nie można zmienić koloru punktora elementu listy. Możesz jednak wykonać kilka sztuczek CSS, aby to umożliwić. Pamiętaj, że może być konieczne dostosowanie go nieco inaczej, jeśli używasz struktury CSS lub specjalnego arkusza stylów:
Przykład
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) */
}