Here’s the complete source of an HTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head></head>
<body>
one<br>
two<br />
three<br></br>
four
</body>
</html>
Can anyone explain why an extra blank line appears between the “three” and the “four” when I view the page in IE8 or chrome?
I thought standards were supposed to make all browsers look the same and as far as I can see this page conforms to the XHTML transitional standard
Because
the XHTML specHTML Compatability Guidelines specify thatbrmustshould be self closing. Apparently Chrome and IE8 are not follwing the spec and closing the open one for you, thus creating a second line break.