I’ve setup a simple webpage, and there is a weird gap at the top which I don’t know how to fix. Other sites I’ve developed haven’t had this issue at all..?
Here’s my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>sitename</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<div id="wrapper">
lorem ipsum
</div>
</body>
</html>
And the CSS:
body {
background-color:#323232;
}
#wrapper {
width:960px;
margin:0pt auto;
background-color:#272727;
}
And here’s a pic of the weird gap:

Is this just my version of FireFox acting up temporarily or am I doing something obviously wrong?
I think by default browsers do tend to add margin or padding to either the
<html>or<body>element, I can never remember which.Edit: as per other answers and comments (e.g. Rahool’s), looks like it’s
marginon<body>.So this should sort out your issue: