Vlastnost klipové cesty CSS
Příklad
Ořízněte obrázek na kruh o velikosti 50 %:
img {
clip-path:
circle(50%);
}
Definice a použití
Tato clip-path
vlastnost vám umožňuje oříznout prvek do základního tvaru nebo do zdroje SVG.
Poznámka: Vlastnost clip-path
nahradí zastaralou clip
vlastnost.
Výchozí hodnota: | žádný |
---|---|
Zděděno: | Ne |
Animovatelné: | ano pro základní tvar . Přečtěte si o tématu Animable |
Verze: | Modul maskování CSS úrovně 1 |
Syntaxe JavaScriptu: | objekt .style.clipPath="kruh(50%)" |
Podpora prohlížeče
Čísla v tabulce určují první verzi prohlížeče, která plně podporuje vlastnost.
Property | |||||
---|---|---|---|---|---|
clip-path | 55.0 23.0 -webkit- |
79.0* | 54.0 | 9.1 6.1 -webkit- |
42.0 15.0 -webkit- |
* Před verzí 79 Edge podporoval pouze ořezovou cestu u prvků SVG (nikoli prvků HTML).
Syntaxe CSS
clip: clip-source|basic-shape|margin-box|border-box|padding-box|content-box|fill-box|stroke-box|view-box|none|initial|inherit;
Hodnoty vlastností
Value | Description | Play it |
---|---|---|
clip-source | Defines a URL to an SVG <clipPath> element | |
basic-shape | Clips an element to a basic shape: circle, ellipse, polygon or inset | |
margin-box | Uses the margin box as the reference box | |
border-box | Uses the border box as the reference box | |
padding-box | Uses the padding box as the reference box | |
content-box | Uses the content box as the reference box | |
fill-box | Uses the object bounding box as reference box | |
stroke-box | Uses the stroke bounding box as reference box | |
view-box | Uses the SVG viewport as reference box | |
none | This is default. No clipping is done | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |