I have a background image which is 1920x579px and I want its width to cover the full screen but not its height because the height would look ugly if stretched until the bottom. Please help me! I really tried everything!
Asked
Active
Viewed 1,039 times
-1
-
background-size: 100% auto; maybe? – Sgoldy Feb 09 '14 at 14:50
-
possible duplicate of [Stretch and scale a CSS image in the background - with CSS only](http://stackoverflow.com/questions/1150163/stretch-and-scale-a-css-image-in-the-background-with-css-only) – Qantas 94 Heavy Feb 09 '14 at 14:55
2 Answers
0
You could use the background-size: width height;
property.
body{
background-size: 100% auto;
background-repeat: no-repeat;
}

Alex
- 122
- 9
0
you can set the image in the css
BODY {
background: url(image.jpg) no-repeat center -100px fixed;
}
the -100px
can be adjusted to move the image up or down.

malta
- 858
- 1
- 9
- 17