CKTIS / CSS
Właściwość CSS `list-style-type`
`list-style-type` wybiera glif, ciąg lub styl licznika używany przez znacznik listy.
Wersja: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Składnia
<counter-style> | <string> | nonelist-style-type wybiera glif, ciąg lub styl licznika używany przez znacznik listy.
Przykład ustawia square na li i raportuje listStyleType oraz styl ::marker.
Akceptowana gramatyka to <counter-style> | <string> | none; wartości globalne nadal podlegają kaskadzie.
Poprawny list-style-image ma pierwszeństwo przed typem; none usuwa symbol, lecz element nadal zachowuje semantykę listy.
Przykłady
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>CKTIS CSS reference example</title>
<body><div class="probe">probe</div><pre id="result"></pre><script>
document.body.innerHTML = '<ul><li id="item">entry</li></ul><pre id="result"></pre>';
const item=document.querySelector("#item");const property="list-style-type";const candidates=["square"];
const value=candidates.find(candidate=>CSS.supports(property,candidate));item.style.setProperty(property,value);
const style=getComputedStyle(item);const marker=getComputedStyle(item,"::marker");
document.querySelector("#result").textContent="value="+value+"; type="+style.listStyleType+"; position="+style.listStylePosition+"; image="+style.listStyleImage+"; marker="+marker.display;
</script></body></html>Wynik
value=square; type=square; position=outside; image=none; marker=inline-block
Przykład uruchomiono lokalnie w izolowanej, bezsieciowej sesji Chrome; wynik pochodzi z API CSS przeglądarki.