Gaara Ichimaru Posted April 14, 2011 Share 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 Link to comment Share on other sites More sharing options...
Djkanna Posted April 14, 2011 Share Posted April 14, 2011 Not sure what spacecont.png looks like but if it's repeatable, repeat it. Quote Link to comment Share on other sites More sharing options...
Gaara Ichimaru Posted April 14, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
sniko Posted April 17, 2011 Share Posted April 17, 2011 Instead of background-size: 100%; Try background-width: 100%; background-height: 100%; -sniko Quote Link to comment Share on other sites More sharing options...
Gaara Ichimaru Posted April 21, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
rulerofzu Posted April 21, 2011 Share 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 Link to comment Share on other sites More sharing options...
become Posted May 5, 2011 Share Posted May 5, 2011 body { background: #D5DCE2 url('images/spacecont.png'); background-size: 100%; margin:0%; } Try that (: Quote Link to comment Share on other sites More sharing options...
Gaara Ichimaru Posted May 5, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
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.