Lody Posted June 21, 2009 Report Share Posted June 21, 2009 (edited) Hy, I've got a ploblem with the size of my background image. I want is to fit the whole screen when somebody opens my page but somehow I can't get it to work. I've got in mijn HTML page: 3s rge Edited June 21, 2009 by Lody Quote Link to comment Share on other sites More sharing options...
Andrea Posted June 21, 2009 Report Share Posted June 21, 2009 For starters, you're missing the opening body tag. I am viewing at a resolution of 1280 x 1024, and I see the image repeating horizontally. For starters, set it to no-repeat, but if you get to it always adjust to 100% of any resolution, it'll be pretty distorted on some. It might be better to use it as the background of a set width/length division. Also you might want to consider that text over background images is often very hard to read. Quote Link to comment Share on other sites More sharing options...
Lody Posted June 21, 2009 Author Report Share Posted June 21, 2009 I've added "background-repeat: no-repeat;" but it stays the same. It's still the same. Please support your comment by code I can use. Quote Link to comment Share on other sites More sharing options...
Andrea Posted June 21, 2009 Report Share Posted June 21, 2009 It's probably the same to you because your resolution isn't any larger than the image width. I now only see it once. but there's a while background peeking out on the right side of it - approx. 110px wide. Quote Link to comment Share on other sites More sharing options...
Wickham Posted June 22, 2009 Report Share Posted June 22, 2009 (edited) Here's an example which stretches. Make your viewing window smaller and drag the window wider and narrower. The image will always be full width and the height will adjust accordingly. It doesn't work in IE6. http://www.wickham43.net/backgroundfullwidthflexible.html Edit: it does work in IE6 except that the image scrolls with the page, whereas in modern browsers it's fixed to the top. Edited June 22, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
Lody Posted June 22, 2009 Author Report Share Posted June 22, 2009 Hi Wickham, Than I n eed to add something like to my HTML code and I woulke like to do all the background work in the CSS. Do you know an other solution? Quote Link to comment Share on other sites More sharing options...
Wickham Posted June 22, 2009 Report Share Posted June 22, 2009 Hi Wickham, Than I n eed to add something like to my HTML code and I woulke like to do all the background work in the CSS. Do you know an other solution? No, because a background-image in the CSS stylesheet cannot stretch; you have to use a code with a normal image in the html markup to get it to stretch. Quote Link to comment Share on other sites More sharing options...
Lody Posted June 22, 2009 Author Report Share Posted June 22, 2009 Thanks, I heard something like that from someone else also in an other forum. Can I still use filter:alfa when I implement the backgrouind the other way? 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.
Note: Your post will require moderator approval before it will be visible.