Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Hacking away at building my own website, want to dive deeper Reply To: Hacking away at building my own website, want to dive deeper

#239667
Shikkediel
Participant

Making an image fullscreen and showing it completely the same for all aspect ratios is virtually impossible. But this is usually as good as it gets :

mydiv {
background-size: contain;
}

It will require an image that has a fair amount of “free space” at the edges, of which it would not really matter if it’s fully showing or not. With different aspect ratios, either a bit of the top and bottom or the sides will not be showing.

I would make a div with these dimensions for it, then probably position the header absolutely on top to avoid having to use calc(), which isn’t very well supported on Android:

mydiv {
height: 100vh;
}

For a parallax effect like on the other site, you’ll be needing JavaScript.