The following Code
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div style="width:200px;height:200px;padding:0px;margin:0px;">
<div style="background-color:red;position:relative;display:block;text-decoration:none;padding:0px;margin:0px;">
<img style="padding:0px;margin:0px;width:200px;height:200px;" src="http://www.google.com/logos/2012/serbia12-hp.jpg">
</div>
</div>
</body>
Has a very strange red border on the bottom, I was not able to figure out why this happnes (both with Chrome and IE).

If i use an Invalid Doctype like (withouth exclamation markt)
<DOCTYPE html>
It works?
What is the reason for this? Why is the image not exactly the same width and height as the outer box (200px by 200px). I have tried everything but have no clue why this happens? Is this an hmtl Bug or what am I doing wrong?
Side Note: This is a much mor complicated HTML construct. The example above does not make sense, but it illustrates the problem. So it would be kind if you could explain why this happens.
Thanks very much!
The default line spacing in your browser does not divide evenly into 200. Because an
<img>displays asinlineby default, it respects line-spacing. You are seeing the result of this.Setting the
<img>todisplay: block;will resolve your issue.