9

I am trying to develop a web site from scratch. Here is the code

<html>
<head>
</head>
<body >
<div id="top" style="height:200px;background-color:green">
</div>
<div id="middle" style="height:800px;background-color:white">
</div>
<div id="footer" style="height:200px;background-color:green">
</div>

</body>
</html>

Problem is that there is a white space around above div tags. I can remove white space using margin: -10px; property. But I don't like to handle it that way. Is there way to handle this in decent way in css?

2 Answers 2

22
<body style="margin: 0;">
0
9

Set the margin for the body to 0;

<body style = "margin:0">
2
  • OOPS! Sorry. Didn't see the answer above. Due to my slower internet connection, I got some delay in posting the answer.
    – Zelal
    Jan 26, 2013 at 18:39
  • 1
    Putting spaces around the =s of attributes is against the XML standard.
    – Cobra_Fast
    Jan 26, 2013 at 23:55

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.