Clip

Clip CSS properties define a clipping path that determines the visible portion of an element.

Clip Properties

clip-path

Defines the shape that determines which part of an element should be visible.

  • noneno clipping path
  • url(...)e.g. url(resources.svg#id); referencing an SVG <clipPath id="..."> element (see <clipPath> example here)
  • a geometry boxuse the specified box, including corner shaping via border-radius, to be the clipping path; specify any of: margin-box, border-box, padding-box, content-box, fill-box, stroke-box, view-box
  • a basic shapesee basic shape data type, e.g. circle(...), ellipse(...), polygon(...)
| LIVE PREVIEW

clip

Deprecated, use the newer clip-path property instead.

Defines a visible portion of an element. Only applies to absolutely positioned elements (i.e., those with position: absolute or position: fixed.)

Specify:

  • autono clipping (default)
  • rect(top, right, bottom, left)e.g. rect(0, 175px, 113px, 0) (as offsets from the top/left border); defines the rectangle for the clipping
div {
  clip: rect(1px, 10em, 3rem, 2ch);
}

Assets

References