Lista stylówWłaściwość stylu
Przykład
Zmień styl listy:
document.getElementById("myList").style.listStyle = "decimal inside";
Definicja i użycie
Właściwość listStyle ustawia lub zwraca maksymalnie trzy oddzielne właściwości listy w formie skróconej.
Za pomocą tej właściwości możesz ustawić/zwrócić jedno lub więcej z poniższych (w dowolnej kolejności):
- typ-listy
- pozycja w stylu listy
- obraz w stylu listy
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
listStyle | Yes | Yes | Yes | Yes | Yes |
Składnia
Zwróć właściwość listStyle:
object.style.listStyle
Ustaw właściwość listStyle:
object.style.listStyle = "type position image|initial|inherit"
Wartości nieruchomości
Parameter | Description |
---|---|
type | Defines the list-item marker type |
position | Positions the list-item marker |
image | Defines an image to be used as the list-item marker |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Szczegóły techniczne
Domyślna wartość: | dysk na zewnątrz brak |
---|---|
Wartość zwrotu: | String, reprezentujący styl listy |
Wersja CSS | CSS1 |
Więcej przykładów
Przykład
Zmień typ i pozycję listy na „kwadratowe w środku”:
document.getElementById("myList").style.listStyle = "square inside";
Przykład
Zwróć styl listy:
document.getElementById("myList").style.listStyle;
Powiązane strony
Samouczek CSS: Lista CSS
Odniesienie CSS: właściwość w stylu listy
❮ Obiekt stylu