Clipping Elements


It is possible to "clip" an element, so that only a small rectangle of it is visible instead of the entire element. This might be used to show only a part of an image, for example. Only absolutely positioned elements can be clipped.

Name:

clip

Value:

<shape> | auto

Initial:

auto

Applies to:

absolutely Positioned elements

Inherited:

no

Percentages:

N/A


The <shape> value describes a rectangle, for example:

 #p1 { clip: rect(5px, 310px, 255px, 10px) } 

The order of the values inside rect() is top, right, bottom, left. This rule therefore shows the part of the image that starts 5px from the top and 10px from the left, and is 300px wide (= 310 10) and 250px high (= 255 5).



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net