Jump to content

vh + rem


Recommended Posts

Hi there,

I am hoping to create a container that starts part way down a page, and fills out the majority of space below it (minus some padding before the footer). I wrote the following:

min-height: calc(100vh - 15.44rem);

The rem size is the 247 pixels above and below that it isn't to fill out. This works, until the base font size is increased. Is there a solution to keeping this the correct min height? I could have just written the px value, but the elements above are rem sized as well so these will push the container down when the base font size is increased.

Hope that makes sense?


Link to comment
Share on other sites

min-height doesn't stop your container from expanding to fit its contents. It just prevents it from getting smaller.

You're probably looking for something like max-height for this issue. Or even a fixed height.

Edited by Funce
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...