Why document.body.style.margin
returns me nothing in chrome and firefox if the
style="margin:[some] px" is not set for body.
Now suppose I want the margins of body using offsetParent.offsetLeft
css property by some child Element of div.It gives me 0px by default.Well if the body element is initially at default 0px margin then why does my html visual elements are displayed with some margin from left of the page which comes out to be 8px.
Is the body margin 0 px only??
HTML :
<div>
<p>hello</p>
</div>
CSS:
div {
height:200px;
width:200px;
background:green;
border:2px solid green;
padding:10px 10px
}
p {
height:100px;
width:100px;
padding:10px 0 0 10px;
background:yellow
}