Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. clip

clip

Specifies whether to clip (crop) and display a box.

The 'clip' property can only be applied to elements whose 'position' property is set to 'absolute' or 'fixed'.

Sample Code

div.test { clip: auto;}
div.test1 { clip: rect(10px, 20px, 30px, 40px);}

Available Values

ValueDescription
autoNo clipping is applied. This 'auto' is the initial value.
rect()Specifies the clipping region relative to the top-left corner of the box. The syntax is 'rect(distance from top, distance from left to right edge, distance from top to bottom edge, distance from left)'.

Browser Preview

<div style="clip: auto; position: absolute; background-color: yellow; width: 200px; height: 200px;">A 200px × 200px div element with 'position: absolute'.</div>

<div style="clip: rect(5px, 195px, 195px, 5px); position: absolute; background-color: yellow; width: 200px; height: 200px;">A 200px × 200px div element with 'position: absolute'.</div>

<div style="clip: rect(5px, 195px, 195px, 5px); position: fixed; background-color: yellow; width: 200px; height: 200px;">A 200px × 200px div element with 'position: fixed'.</div>

Browser Support

Chrome Chrome
1+
Firefox Firefox
1+
Safari Safari
1+
Edge Edge
12+
Supported in all versions
IE IE
11
10
9
8
7
6
Opera Opera
7+
6 and earlier ×
iOS Safari iOS Safari
1+
Android Android Browser
4.4+
3 and earlier ×
Chrome Android Chrome Android
Latest
Same support as desktop
Firefox Android Firefox Android
Latest
Same support as desktop

※ Version data based on MDN.

Overview

Specifies whether to clip (crop) and display a box.

The 'clip' property can only be applied to elements whose 'position' property is set to 'absolute' or 'fixed'.

The syntax for 'rect()' is 'rect(distance from top, distance from left to right edge, distance from top to bottom edge, distance from left)'. Values can be separated by ',' or a space, but the standard is ',' so it is recommended to use ','. Note that IE7 and earlier only support space as a separator.

div.test { clip: rect(10px, 20px, 30px, 40px);} /* This is the standard syntax. */
div.test1 { clip: rect(10px 20px 30px 40px);} /* Use this for IE7 and earlier. */

If you find any errors or copyright issues, please .