E
E
Evtera2021-01-05 21:32:10
css
Evtera, 2021-01-05 21:32:10

How to use 100vh correctly?

Hello. Such a situation:

The site has a header, under it there is a block with a picture for the entire height of the screen. I set the min-height parameter to it: 100vh. The block is stretched and a scroll appears the size of the height of the site header.

Can you tell me how to remove this scroll? Iterating over the min-height value is not an option. I tried to set a fixed height for the header, and then min-height: calc(100vh - #{$headerHeight}). It works, but it looks like a crutch.

Are there any more elegant options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2021-01-05
@Evtera

Grids can be used. Container with 100vh height and 2 rows. min-content and 1fr

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question