Gaara Ichimaru Posted April 14, 2011 Posted April 14, 2011 I have a background image and I want it to fix any browser screen hence stretch to 100%. It's not doing it >.< Not sure how to stetch it and it's driving me mad, here's my CSS body { background-image:url('images/spacecont.png'); background-size: 100%; background-color:#D5DCE2; margin-top: 0px; margin-bottom: 0px; } I know It's probably simple, I'm just missing it :( Please ignore the random <br />'s they aren't part of the code :) Thanks. Quote
Djkanna Posted April 14, 2011 Posted April 14, 2011 Not sure what spacecont.png looks like but if it's repeatable, repeat it. Quote
Gaara Ichimaru Posted April 14, 2011 Author Posted April 14, 2011 Not sure what spacecont.png looks like but if it's repeatable, repeat it. it's not, two contrasting colours eaither side so repeat-x isn't viable :/ Thanks anyway. Quote
sniko Posted April 17, 2011 Posted April 17, 2011 Instead of background-size: 100%; Try background-width: 100%; background-height: 100%; -sniko Quote
Gaara Ichimaru Posted April 21, 2011 Author Posted April 21, 2011 Instead of background-size: 100%; Try background-width: 100%; background-height: 100%; -sniko Thanks anyway, but still, doesn't work :/ Quote
rulerofzu Posted April 21, 2011 Posted April 21, 2011 Would be better if you could post the image so people can see what your working with. What size is your image? you may find this easier to shrink a larger image than stretch a smaller one. Quote
become Posted May 5, 2011 Posted May 5, 2011 body { background: #D5DCE2 url('images/spacecont.png'); background-size: 100%; margin:0%; } Try that (: Quote
Gaara Ichimaru Posted May 5, 2011 Author Posted May 5, 2011 body { background: #D5DCE2 url('images/spacecont.png'); background-size: 100%; margin:0%; } Try that (: Thanks, I got it now, the code didn't work for me, but I've gone for a fade out now `cause everyone seems to be >.< Question answered :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.