Forum Moderators: not2easy
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
}
.header {
color: #FFFFFF;
background-color: #000000;
height: 100px;
}
-->
</style>
</head>
<body>
<div class="header"><img style="float:left" src="http://i.a.cnn.net/cnn/.element/img/1.3/ceiling/logo.cnn.com.gif" /></div>
</body>
</html>
However, if I put it inside another <div> and apply float:left to the divisoin, the gap is gone:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
}
.header {
color: #FFFFFF;
background-color: #000000;
height: 100px;
}
-->
</style>
</head>
<body>
<div class="header"><div style="float:left"><img src="http://i.a.cnn.net/cnn/.element/img/1.3/ceiling/logo.cnn.com.gif" /></div></div>
</body>
</html>
Is there better approach to fix the problem without using excessive <div> tags?
try removing...
<?xml version="1.0" encoding="iso-8859-1"?>
..as it sends IE into Quirks Mode. :o
birdbrain