Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - crop image - top and bottom

Tags:

html

css

I have got this image:

image 1

And I want to crop 200px from top and 200px from bottom.

Cropped image:

image 2

I want to do this in CSS.

How can I achieve that?

like image 885
Pavel Jílek Avatar asked Sep 16 '25 17:09

Pavel Jílek


1 Answers

You can use the CSS property called clip. Have a look at the documentation here.

For example:

img {
    position: absolute;
    clip: rect(0px,60px,200px,0px);
}
like image 101
Mike Resoli Avatar answered Sep 18 '25 06:09

Mike Resoli