Shashank Gaurav Shashank Gaurav - 1 year ago 83
CSS Question

Is there any feature in html/css to crop the image?

I have a image which I want to crop and then use it accordingly for my project using html/css. I don't want to use any photo editor.

Answer Source

here's an example:

<div id="test">
<img id="image" src="LINK to Image">

and for CSS:

overflow: hidden;
height: (number)px;
width: (number)px;

position: relative;
top: (number)px;
left: (number)px;

so the (position: relative) of the image will allow you to move it with top and left in relation to the div. The height and width of the div will be the crop area.

Hope this helps

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download