Community forum for knowledge and support

Updated 10 months ago

Centering Text and Maintaining Image Height in a 100vh Hero Section

At a glance

The community member wants the hero section of a page to fill 100vh, with the picture always being the same height and the text centered in the white space. The community members discuss the differences between VH, SVH, and DVH, with one suggesting trying a Relume header component as a starting point. However, there is no explicitly marked answer provided.

Useful resources

I want the hero section of this page to fill 100vh but the picture should always be the same height and the text should be centered in the white. How can I do that?
Read only link

Thank you

M
S
8 comments

have you tried just dropping header 30 in as a starting point?
https://library.relume.io/components/header-30

I just tried that and it didn't work but it gave me an idea how to make it work. Thank you!

What's the difference between VH and SVH?

actually not sure what the difference is - I know that SVH means Static Viewport Height - which is the opposite of DVH - Dynamic Viewport Height. Maybe SVH is just a way to be explicitly saying that it shouldn't be dynamic.

Sorry had to run out for dinner quick, so DVH is for like an example with iOS Safari when the browser URL bar or action bar disappears on scroll - you still want things to be responsive to the actual viewport no matter what is actually on the screen.

got it. so what measurement should I be using then?

yeah I dont have a hard and fast answer to that one honestly - I suppose DVH would be the safest but I'd probably checkout some T.Ricks videos to see if he has any direction, pros/cons for VH/SVH/DVH and VW/SVW/DVW.

the relume components use SVH

Add a reply
Sign up and join the conversation on Slack