<div style="padding: 0px; background-color:yellow;"> Hello <img src="hello.jpg" style="margin:0px;"> </div> Code (markup): Why are there 2px space under the image? Thanks
The image is an inline-level element - as such you are seeing the effect of line-height upon it. Set display:block on it and that padding will go away - though it won't be on the same line. You can control it's position on the line by playing with the vertical-align property. ... oh, and don't trust the default line-height since gecko doesn't use the same default as everyone else (or even on two lines in a row depending on the metric) - you want the image to appear with no border top and bottom, you'll need to set the line-height the same as the image height.