0
I’m having trouble positioning items (div
's), in the case, I need the first div
, occupy all the height and width of the screen, already the others, occupy only the padding
which they receive and the size of the content from within it (without leaking content if it is larger, such as text).
How can I use position relative
, and what can I do with absolute
?
- As
section
's cannot 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>
I did not understand your doubt well, the content is going beyond the divide in which it contains the content or it is going beyond the
main-content
?– RFL
Doubt is how to do, in a way that does not surpass, and that others
sections
follow the flow without overlapping, ta written ...– Murilo Melo
exceed horizontally or vertically? you can put the data you are using to see how it looks?
– RFL
obviously do not exceed horizontal :D
– Murilo Melo
Ta everything there, is just an example to see how it can be done...
– Murilo Melo
It’s not clear yet.
– RFL
div has to occupy 100% of the height and width of the page, and cannot be overwritten or overwritten by others
– Murilo Melo
huahuahua occupy 100% of the page as it cannot be overwritten by others?
– user60252
the others are thrown just below
– Murilo Melo
in the case is the height of the visible part of the page, occupying 100% of it and width
– Murilo Melo
It’s too long, I took the answer. visit this page How to ask a good question? http://answall.com/help/how-to-ask
– user60252
Make an image in photoshop or Paint illustrating how you need it to look, otherwise it becomes difficult to understand.
– Washington da costa