CSS - clip


Description:

The clip property defines the area outside which an absolutely positioned element's content is not visible.

Possible Values:

  • auto: The clipping region is equivalent to the content area of the positioned element.
  • shape: A shape descriptor. As of CSS2, there is only one valid shape: rect(top right bottom left).

Applies to:

block-level and replaced elements.

DOM Syntax:

object.style.clip=rect(top right bottom left);

Example:

Here is the example which shows effect of this property:

<style type="text/css">
div {
  background: url(images/css.gif);
  clip:rect(10px, 155px, 145px, 10px);
  border:2px solid black;
  height:100px;
  width:150px;
  position:absolute;
  top:inherit;
  left:0px;
}
</style>
<div>
Example of clipping one image using css clip property
</div>
     

 





Spacer Bottom Left Corner ImageBottom Right Corner Image
Valid XHTML 1.0 Strict  Valid CSS! Check the accessibility of this site according to U.S. Section 508