My HTML :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LOL</title>
</head>
<body>
<div id="one"></div>
</body>
</html>
CSS :
div {
background: yellow;
width: 77px;
height: 77px;
border: 1px dotted red
}
#one {
margin: 0px 21px 41px 41px
}
My margin-top value is 0px, nevertheless, a spacing beetwen my square and the top of the page appears.
Why?
Here is an illustration :
And JSFiddle : http://jsfiddle.net/9vQZ9/1/
Demo Fiddle
CSS
Many designers even use, to reset padding and margins of all elements, if any
This is browser's body default CSS which is margin:8px; To rewrite that, use this CSS as well:
add this:-