Resizing background - Post ID 486

User 414252 Photo


Registered User
7 posts

Hi all,

is there a way to stretch a background to make it the same size as a users screen resolution?
so that the background will look the same for a user on 640 * 400 as 800* 600 ?

i want to set the screen so it automatically resizes to full screen and have the background fill the screen , repeat would look terrible in this situation.
User 132952 Photo


Ambassador
3,120 posts

I honestly didn't think it was possible, but if you Google something like Html Stretch Background Image, there's actually a few suggestions that seem to work, although it takes some extra work:
http://www.htmlite.com/faq022.php
User 414252 Photo


Registered User
7 posts

Thank you adam for your help, I kinda thought i would have to use img and z-order rather than background . the only other option i found was blowing the picture up to the largest window size i could find using coffeecup pix converter of course. that kinda worked but the file size id a bit large for dialup.

thank you for your help.
User 456980 Photo


Registered User
81 posts

I have the same sort of problem on one of the websites I manage, what I do is manually insert the image in each page and make it the biggest size in coffeecup... pain in the neck, file is huge, but it works.
I work on my computer mainly for the purpose of working on my computer.
User 282670 Photo


Registered User
3,940 posts

not a code guru by far MK but try this:
<style type="text/css">
BODY {
background: url("imaGe goes here");
background-repeat: repeat-y repeat-x;
background-attachment: fixed;
}
</style>
see what it does for you. goes in head section--3d bg




User 414252 Photo


Registered User
7 posts

ok this looks terrible because it is currently on a free hosting account but check this out swanwebdesign.bravehost.com
User 456980 Photo


Registered User
81 posts

looks to me like you've got a fixed, one-photo background there!
It is centered in the page, with blue in the empty space around it... maybe 20 px worth of blue space.
Thanks Bruce for that code... we'll see if I can make it work.
I work on my computer mainly for the purpose of working on my computer.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.