0
I’m hoping that the #div1
get away from #fisrt
and does not lead to #second
together, but it’s not working with margin-top: 5px;
in #div1;
. That is, between the junction of the #first
with the #second
I want the #div1
move away 5px without taking the #second
.
Follows the code:
* {
margin: 0 auto;
padding: 0 0 0 0;
}
#first {
background: blue;
width: 100%;
height: 34px;
}
#second {
background-color: gray;
width: 100%;
height: 100%;
background: red;
}
#div1 {
background: green;
width: 200px;
height: 30px;
margin-top: 10px;
}
<div id="first">
</div>
<div id="second">
<div id="div1"> Destaques </div>
</div>
William hello, why not just do:
margin: 9px auto 0 auto;
? You didn’t need to shootmargin-top: ...
afterward– Miguel
@Miguel may be, anyway I left as it was for the author better understand the example
– Guilherme Nascimento