tags:

views:

122

answers:

3

Hi,

I have an image that is too big and I want to put it into an tag but I don't want to shrink the image, I'd like it just clipped.

This is due to IE incorporating margin and padding into the overall width.

Is there a way to sort this?

+8  A: 

Wrap the image in a div and set the height and width of the div.

SO

<div style="height:20;width:20;overflow:hidden">
   <img src="someURL"/>
</div>
Kevin
I've used overflow:hidden rather than :none but works sweet. Thanks
Fermin
You are correct, my bad. I've updated it to fix the mistake.
Kevin
+3  A: 

I think you want the CSS clip property.

chaos
+1  A: 

IE6 should use the proper box model when given a Doctype i.e., the width of the box should be the sum of the width, padding, and border properties. When the Doctype is missing, IE6 is thrown into quirks mode and will use the IE Box Model.

moorej