Link to home
Start Free TrialLog in
Avatar of cactuses37
cactuses37

asked on

Div layer leaving left gap on very simple code

Hi, I am attaching some very simple html code. When I run that source I keep getting a gap to the left side of each div tag. I have demonstrated my issue below by showing a nested div and also a div alone in the body. I do not want a gap to the left.

Very simple! please help!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
#wrapper {
	width: 100%;
}
#header {
	background-color: #990000;
}
#alone {
	background-color:#3300FF
}
body {
	background-color: #996633;
}
-->
</style>
</head>
 
<body>
<div id="wrapper" align="center">
  <div id="header">Why is there a gap on top and left? (this is the nested div)</div>
</div>
<div id="alone">I dont want a brown gap on the left. (this div is not nested)</div>
 
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of LordWolfy
LordWolfy
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial