I'm wanting #div1
to move away from #fisrt
and not to #second
together, but it's not working with margin-top: 5px;
on #div1;
. That is, between joining #first
and #second
I want #div1
to move away 5px without leading to #second
.
Follow 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>