6
I have an element <p> within a <div>, thus:
HTML
<div>
<p>texto</p>
</div>
CSS
div {
width: 30px;
height:30px;
background-color: green;
}
p {
width: 30px;
height:30px;
background-color: red;
margin: 10px 10px 10px 10px;
}
When I apply margin-left works normally, the element <p> distance 10px on the left, but when I apply margin-top, margin-bottom or margin-right nothing is changed, the <p> remains in the same position. I don’t understand why, someone can explain this behavior ?


Thank you very much ! Doubt clarified.
– Willian Ribeiro