CKTIS / CSS
CSS-eigenschap `list-style-type`
`list-style-type` kiest het teken, de tekst of de tellerstijl van de lijstmarkering.
Versie: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<counter-style> | <string> | nonelist-style-type kiest het teken, de tekst of de tellerstijl van de lijstmarkering.
Het voorbeeld stelt square op een echte li in en meldt listStyleType en ::marker.
De geaccepteerde grammatica is <counter-style> | <string> | none; globale waarden blijven deelnemen aan de cascade.
Een geldig list-style-image krijgt voorrang; none verwijdert het symbool maar niet de lijstsemantiek.
Voorbeelden
<!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>Resultaat
value=square; type=square; position=outside; image=none; marker=inline-block
Het voorbeeld is lokaal uitgevoerd in een geïsoleerde Chrome-sessie zonder netwerk; het resultaat komt uit de CSS-API van de browser.