CKTIS / CSS
shape-image-threshold — práh alfa pro obtékací tvar
shape-image-threshold vybírá pixely obrázku, které určují oblast, jíž se text kolem plovoucího prvku vyhýbá.
Verze: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntaxe
shape-image-threshold: <opacity-value>;shape-image-threshold funguje s obrázkem v shape-outside: tvar zahrnuje pixely, jejichž hodnota alfa je striktně větší než práh. Vlastnost obrázek neořezává ani nemění jeho viditelný vzhled; neřídí tvar circle().
Výchozí hodnota je 0; vlastnost se nedědí. Čísla mimo [0,1] se omezí na hranice tohoto rozsahu. Při hodnotě 1 je tvar prázdný, protože žádný pixel nemá vyšší hodnotu alfa.
Příklad používá přechod bez externích zdrojů. Práh 0.5 vybere jeho neprůhlednou levou polovinu.
Příklady
<!doctype html>
<meta charset="utf-8">
<title>shape-image-threshold</title>
<style>
.demo { width: 320px; display: flow-root; font: 16px/24px monospace; }
.shape {
float: left;
width: 160px;
height: 120px;
shape-outside: linear-gradient(to right, #000 80px, transparent 80px);
shape-image-threshold: 0.5;
}
p { margin: 0; }
</style>
<div class="demo">
<div class="shape" aria-hidden="true"></div>
<p>Alpha defines the wrapping area. Alpha defines the wrapping area. Alpha defines the wrapping area. Alpha defines the wrapping area. Alpha defines the wrapping area.</p>
</div>Výsledek
Expected: text beside the float starts 80px from the container's left edge, rather than 160px. With shape-image-threshold: 1, the shape is empty and text starts at the left edge.
Zobrazený kód a uvedený výsledek byly ověřeny v izolovaném prostředí metodou zaznamenanou v dokladu o ověření této přesné verze.