#can anyone help with css

29 messages · Page 1 of 1 (latest)

frail holly
#

check image

#

Use math calc(100vh-8px)

frail holly
#

I'm 99% certain that calc(100vh-8px) does what you want. If its not working, the problem lies elsewhere.

tawny void
#

you need spaces around -

#

calc(100vh - 8px)

frail holly
tawny void
#

firefox says it's invalid without spaces and it won't work

frail holly
#

That's where the 1% uncertainty went

frail holly
#

thanks

tawny void
#

I wouldn't use that approach though, because on mobile browsers the browser interface might screw this up. Mobile browsers and vh are a pain.

frail holly
#

Since it'll overflow in most cases where you need vh.

#

Just have it fit the contents

tawny void
#

I'd just use flex to dynamically make the page full height. No need for height.

frail holly
#

For mobile, it'll be inevitable to have scrolling so making anything full height doesn't really make sense.

#

Making the main wrapper a flexbox would introduce alot of scrolling challenges.

#

If you set an element to fill the gap, it can't expand past its container.

#

If you really want something to occupy most of the screen for mobile (e.g. force the footer on bottom, then use min-height: 100vh

#

So it can still expand if needed

tawny void
#

it really depends on what you want to do

#

i'm assuming the sidebar and the main content should each have their own scrollbar

#

as scrolling the entire thing with a sidebar doesn't make much sense

frail holly
tawny void
#

again, depends

frail holly
#

Then I'd agree, but having a sidebar on mobile is just.. bad design?

tawny void
#

if it can be minimized, sure