Path: blob/main/files/en-us/web/svg/attribute/clip-path/index.md
6552 views
------{{SVGRef}}
The clip-path presentation attribute defines or associates a clipping path with the element it is related to.
Note: As a presentation attribute
clip-pathcan be used as a CSS property.
You can use this attribute with the following SVG elements:
{{SVGElement('a')}}
{{SVGElement('circle')}}
{{SVGElement('clipPath')}}
{{SVGElement('ellipse')}}
{{SVGElement('g')}}
{{SVGElement('glyph')}}
{{SVGElement('image')}}
{{SVGElement('line')}}
{{SVGElement('marker')}}
{{SVGElement('mask')}}
{{SVGElement('path')}}
{{SVGElement('pattern')}}
{{SVGElement('polygon')}}
{{SVGElement('polyline')}}
{{SVGElement('rect')}}
{{SVGElement('svg')}}
{{SVGElement('symbol')}}
{{SVGElement('text')}}
{{SVGElement('use')}}
Example
{{EmbedLiveSample("Example", '100%', 200)}}
Usage notes
| Value |
{{cssxref('url')}} | [ {{cssxref('basic-shape')}} ||
<geometry-box> ] | none
|
|---|---|
| Default value | none |
| Animatable | Yes |
<geometry-box>
: An extra information to tell how a {{cssxref('basic-shape')}} is applied to an element:
fill-boxindicates to use the object bounding box;stroke-boxindicates to use the object bounding box extended with the stroke;view-boxindicates to use the nearest SVG viewport as the reference box.
Note: For more details on the clip-path syntax, see the CSS property {{cssxref('clip-path')}} reference page.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
The CSS {{cssxref("clip-path")}} property