clipPath Redirect 1

The clipping path restricts the region to which paint can be applied. Conceptually, any parts of the drawing that lie outside of the region bounded by the currently active clipping path are not drawn.

A clipping path is defined with a clipPath element. A clipping path is used/referenced using the clip-path property.

A clipping path is conceptually equivalent to a custom viewport for the referencing element. Thus, it affects the rendering of an element, but not the element's inherent geometry. The bounding box of a clipped element (meaning, an element which references a clipPath element via a clip-path property, or a child of the referencing element) must remain the same as if it were not clipped.

By default, pointer-events must not be dispatched on the clipped (non-visible) regions of a shape. For example, a circle with a radius of 10 which is clipped to a circle with a radius of 5 will not receive "click" events outside the smaller radius.

Usage context

Categories None
Permitted content Any number of the following elements, in any order:
Animation elements »
Descriptive elements »
Shape elements »
<text>, <use>
Normative document SVG 1.1 (2nd Edition)

Example

Source code Output result

Unable to find file clip-path-1.svg

Unable to find file clip-path-1.svg

» clip-path-1.svg

Attributes

Global attributes

Specific attributes

DOM Interface

This element implements the SVGClipPathElement interface.

Browser compatibility

Feature Chrome Firefox (Gecko) IE Opera Safari
Basic support 1.0 1.5 (1.8) 9.0 9.0 3.0.4
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 3.0 1.0 (1.8) Not supported (Yes) 3.0.4

The chart is based on these sources.

Document Tags and Contributors

Contributors to this page: Jeremie
Last updated by: Jeremie,