-1

I'm new to using vh/vw values in css, but it's come in handy on my current project, where I want the main content container to fill the whole viewport height. This works fantastically until the viewport is shrunk vertically to around 200/300px, when the layout breaks.

What I want is for it to work exactly as it is (fill the whole screen) but to stop shrinking at a fixed pixel value. However, the following didn't work, as I'd hoped:

.container {
    height: 90vh; 
    min-height: 400px;
}

Can anyone suggest a solution?

Thanks in advance.

Paulos3000
  • 3,355
  • 10
  • 35
  • 68

1 Answers1

3

main content container to fill the whole viewport height

.container {
    height: 100vh; 
    min-height: 300px;
}

1vh — one equal 1/100 height of viewport.

Vlad
  • 91
  • 5