If I add margin-top: 50px;
to #box
then #container
is also getting margin-top
, but If I add #margin-left: 50px
to #box
then why isn't #container
getting margin-left
?
Fiddle
HTML:
<body>
<div id="container">
<div id="box">box</div>
</div>
</body>
CSS:
#container {
width: 500px;
height: 500px;
background-color: gray;
margin-top: 30px;
margin-left: 30px;
}
#box {
width: 100px;
height: 100px;
background-color: orange;
margin-top: 10px;
}