I\'m a new comer to web designing. I created my web page layout using CSS and HTML as below. The problem is even though i set the margin to 0, the upper margin is not settin
You need to set the actual page to margin:0 and padding: 0 to the actual html, not just the body.
use this in your css stylesheet.
*, html {
margin:0;
padding:0;
}
that will set the whole page to 0, for a fresh clean start with no margin or paddings.
It's very simple. just add this to the body -
body{
margin:0;
padding:0;
overflow:hidden;
}
Try...
body {
margin: 0;
padding: 0;
}
jsFiddle.
Because of browsers using different default stylesheets, some people recommend a reset stylesheet such as Eric Meyer's Reset Reloaded.
Try
body {
margin: 0;
padding: 0;
}
instead of
.body {
margin: 0;
padding: 0;
}
Do not select body with class selector.
It seems that nobody actually read your question and looked at your source code. Here's the answer you all have been waiting for:
#header_content p {
margin-top: 0;
}
jsFiddle