PDA

View Full Version : Div Background Image...Resize To Fit Browser Window...???


mark4man
02-13-2010, 02:42 PM
hello again...

I would like to have a background image (.jpg) automatically resize to fit any browser's window...& I read somewhere on the web it should be accomplished by placing the image in a layer (as a background image); & then set the layer size to 100%.

can someone please tell me how the coding goes for this...?

[or...if that is in fact the correct approach? I don't care if it's html or css...I just want it to work. (&...I'm starting off w/ a larger image (so resolution doesn't get lost when going bigger)]

thanks very much,


mark4man


btw - I should add that it's the image's WIDTH I'm interested in resizing...while it's aspect ratio remains in tact.

Corrosive
02-13-2010, 02:54 PM
Try this;

http://www.dreamweaverclub.com/forum/showthread.php?t=35175

or do a search of the forum. This has been answered a few times recently.

mark4man
02-13-2010, 11:37 PM
UPDATE:

tried a bunch of different codes...(including the stu nichols, found here)...found one & edited it 'till it worked...did all that...& the resized image looked bad, anyway

(even tho I started off w/ a larger image, so as to avoid loss of resolution when enlarging...browsers do a crappy job of rescaling; & the subject(s) in my image had a jagged outline when reducing).

so...someone suggested a fixed sized, centered image...& that's what I did.

looks a lot cleaner; & got the job done.

go here:

http://www.moonmixstudios.com

& click on the links for 'Mission' & 'Contact Us' (in the left side vertical navigation bar)

thanks,


mf

Corrosive
02-14-2010, 07:37 AM
browsers do a crappy job of rescaling

That is very true. They are pretty bad at it.

gentleone
02-14-2010, 06:30 PM
UPDATE:

tried a bunch of different codes...(including the stu nichols, found here)...found one & edited it 'till it worked...did all that...& the resized image looked bad, anyway

(even tho I started off w/ a larger image, so as to avoid loss of resolution when enlarging...browsers do a crappy job of rescaling; & the subject(s) in my image had a jagged outline when reducing).

so...someone suggested a fixed sized, centered image...& that's what I did.

looks a lot cleaner; & got the job done.

go here:

http://www.moonmixstudios.com

& click on the links for 'Mission' & 'Contact Us' (in the left side vertical navigation bar)

thanks,


mf

That looks really bad! I don't have such a problem with large backgrounds, so you might be doing something wrong. I used for my coming soon page a large background and that renders pretty smooth and used Stu's method for this one.

See: www.gentlemedia.nl