M
M
MuTaToRage2015-10-10 12:31:01
css
MuTaToRage, 2015-10-10 12:31:01

How to expand parent element to full width of child elements with position absolute?

There is a structure like this:

<html>
<div class=content>
    <div class=head></div>
    <div class=main></div>
</div>
<div class=footer></div>
</html>

main has an absolute position. And the footer sticks to the header. I did with content:
height: 100vp;
and
html, body, .content { height:100%; }
But it turns out only to the height of the screen and not the content content.
PS I apologize for the formatting, I'm writing from my phone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2015-10-10
@MuTaToRage

The most common mistake is to sculpt absolute positioning where it doesn't belong.
2nd mistake is asking a question and not posting the
vp code - doesn't work on apple devices and old browsers.
It seems to me that we need to think carefully about the task and implement it with adequate methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question