CSS/Properties/clip

From W3C Wiki
Jump to: navigation, search

clip

The clip property applies only to absolutely positioned elements.

Description

Values <shape> | auto | inherit
Initial value auto
Applies to absolutely positioned elements
Inherited No


Values

  • <shape>
    Clips an element. The only valid <shape> value is: rect(<top>, <right>, <bottom>, <left>).


  • auto
    The element does not clip.


  • inherit
    Takes the same specified value as the property for the element's parent.


Example

Example A

[style.css]

 img{
   clip: rect(0px, 50px, 50px, 0px);
 }

[index.html]

<body>
  <img src="images/logo.png" alt="W3C">
</body>

Csslist2 clip.png

CSS Reference

The CSS specification defines the clip property in 11.1.2 Clipping.