CKTIS / CSS
Vlastnosť CSS `list-style-type`
`list-style-type` vyberá glyf, reťazec alebo štýl počítadla značky.
Verzia: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<counter-style> | <string> | nonelist-style-type vyberá glyf, reťazec alebo štýl počítadla značky.
Príklad nastaví square na skutočnom li a hlási listStyleType aj ::marker.
Prijímaná gramatika je <counter-style> | <string> | none; globálne hodnoty zostávajú v kaskáde.
Platný list-style-image má prednosť; none odstráni symbol, nie sémantiku zoznamu.
Príklady
<!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>Výsledok
value=square; type=square; position=outside; image=none; marker=inline-block
Príklad bol spustený lokálne v izolovanej relácii Chrome bez siete; výsledok pochádza z CSS API prehliadača.