jonpugh114 — 2010-07-22T16:32:21-04:00 — #1
I'm about to start a site which needs a background image to fill the whole screen, and I was just wondering about how to implement it.
What size image should I use (keeping download times in mind)?
baylisstic — 2010-07-22T16:44:51-04:00 — #2
I answered a similar question to this just yesterday: http://www.sitepoint.com/forums/showthread.php?t=690706
See if that helps you out at all.
black_max — 2010-07-23T01:00:44-04:00 — #3
Ant's suggestions are good ones. I wouldn't recommend using JS to set width/height on anything, and certainly not something as central to your design as your single large BG image.
jonpugh114 — 2010-07-23T04:48:48-04:00 — #4
How does that sound?
What size (width) image should I be going for?
alexdawson — 2010-07-26T03:39:58-04:00 — #5
The simple way to accomplish it would be to have the background image in an IMG element within the document, use absolute positioning to make it 0 at the top, left and 100% wide and tall, then use z-index on the content of the site to position it above the image. When you scale the browser window it'll scale because the height and width on a normal image is taken into account... and it'll appear in the background due to the z-index placing all the content above it. It's not the most semantic solution but it's clean, will validate and will give you the precise look you require with absolutely no scripting (it's the best solution that exists to-date).
Here's an example of it in action: http://www.ringvemedia.com/
ansa — 2010-08-02T03:48:16-04:00 — #6
hi check these two example if u want to use background like these two sites i will snd u css .