I got a little project but it brings me so much trouble…
How to make the image and the white border cover the viewport, where the border is equal all the time?
Here is a screendump of the layout I want, created with Photoshop.
The CSS I tried so far.
body {
background-repeat: no-repeat;
background-position: center center fixed;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-image: url(../img/bg_border.jpg);
}
If you have a clue, any help would be appreciated! Thanks!
2
Answers
Hello you need to wrap your content into
.wrapper
and the background image oncover
inside it.with your height : http://codepen.io/SzymonDziewonski/pen/RWZzGq
and with fluid fullscreen height : http://codepen.io/SzymonDziewonski/pen/jbLjVb
There is a lot of ways of doing that – that’s just two of them
EDIT my mistake – community was right
So as redemption I’m giving code here in snippet.
We learn every day as do I.
First solution: with your height of wrapper container
Second solution: fluid height of wrapper container
Something like this?