Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. SVG
  3. Reference
  4. Attributes
  5. clip

clip

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see thecompatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Theclip attribute defines the visible region of an element. You should useclip-path instead.

Note:As a presentation attribute,clip also has a CSS property counterpart:clip. When both are specified, the CSS property takes priority.

This attribute has the same parameter values as defined for the CSSclip property. Unitless values, which indicate current user coordinates, are permitted on the coordinate values on therect(). The value ofauto defines a clipping path along the bounds of the viewport created by the given element.

You can use this attribute with the following SVG elements:

Example

html,body,svg {  height: 100%;}
html
<svg viewBox="0 0 20 10" xmlns="http://www.w3.org/2000/svg">  <!-- Auto clipping -->  <svg x="0" width="10" height="10" clip="auto">    <circle cx="5" cy="5" r="4" stroke="green" />  </svg>  <!-- Rect(top, right, bottom, left) clipping -->  <svg x="10" width="10" height="10" clip="rect(1, 9, 8, 2)">    <circle cx="5" cy="5" r="4" stroke="green" />  </svg></svg>

Usage notes

Valueauto |rect()
Default valueauto
AnimatableYes

The valueauto defines a clipping path along the bounds of the viewport created by the given element. The valuerect() defines a clipping rectangle following the following syntax:rect(<top>, <right>, <bottom>, <left>). The<top> and<bottom> values specify offsets from thetop border edge of the element viewport, while<right> and<left> specify offsets from theleft border edge of the element viewport.

Specifications

Specification
CSS Masking Module Level 1
# clip-property

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp