ILoggable

A place to keep my thoughts on programming

March 6, 2005 javascript

Image Clipping and Alignment with CSS

The clip attribute in CSS is not what I would call the simplest to understand. Never mind that the rect() function uses a space separated list instead of a comma separated one, but that some browsers still understand comma separated. But the ordering of the clip rect of top right bottom left is just bizarre. Finally to understand what clipping does, it’s important to realize that the clip rect defines a rectangle of what will be shown, defined from the origin, but it does not affect positioning of the image, which still starts at the origin, clipped areas not withstanding.

Since i’ve done this too much over the last week by trial and error, i decided to just put together a quick page illustrating clip usage.

1 to “Image Clipping and Alignment with CSS”

  1. SBL clipping path says...

    Nice post. Keep up the good work.

Leave a comment