Stream: javascript
Topic: more help needed
Jose Costa Teixeira (Feb 15 2021 at 17:39):
How can I set a div size to take as much space vertically as it can?
Jose Costa Teixeira (Feb 15 2021 at 17:39):
i have this and I want to have an empty div in the middle there
image.png
Jose Costa Teixeira (Feb 15 2021 at 17:41):
div height 100% does not work (i guess it takes 100% of the parent div, but that one is also small...
Jose Costa Teixeira (Feb 15 2021 at 17:41):
div height = 600px opens up the space but is silly
Vladimir Ignatov (Feb 15 2021 at 18:20):
The simplest solution is "min-height: calc(100vh - 100px)" where 100px is adjusted to equal the height of the header, footer and everything else you need to subtract. This would only work if everything else (other than the div in question) has a well-known fixed size.
Jose Costa Teixeira (Feb 15 2021 at 18:50):
thanks. I'll test that
Brian Kaney (Feb 15 2021 at 21:32):
(I wish the IG publisher used React components instead of jquery-based fragments)
Jose Costa Teixeira (Feb 15 2021 at 21:48):
(I wish I knew the difference :) )
Last updated: Apr 12 2022 at 19:14 UTC