I'm having problems positioning items ( div
's), in this case, I need the first div
, occupy the entire height and width of the screen, while the others occupy only the padding
they receive and the size of the content from within (without leaking content if it is larger, such as text).
How can I do it using position relative
, and how can I do with absolute
?
-
section
's can not overlap
.main-content{
width:100%;
display:flex;
flex-direction:column;
padding:6px 0;
}
.section{
position:relative;
float:left;
padding:6px;
width:100%;
}
<div class="main-content">
<div class="section banner"></div>
<div class="section"></div>
<div class="section"></div>
</div>