Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stretch Background Image 3

Status
Not open for further replies.

RoguePoet01

Programmer
Oct 1, 2003
302
US
Does anybody know a command in the <BODY> tag that will stretch the background image to full page?
 
No. The only way to do it is using JavaScript / DHTML to provide separate layers.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]
 
When using a background image that cannot repeat I create the image so that it at least 1200 pixels wide.

Tis will cater for the vast majority of browser resolutions.

File size can be an issue however.

Nigel Wilson
&quot;kiwi-kid&quot;
 
Thanks. I'll look into adjusting the height/width numbers with java variables.

 
This is an issue because of the huge range of browsers on various platforms. Even setting it at 1200 as per the above post is an issue, for example I'm currently viewing at 1280 and sometimes 1600 & beyond. There is little agreement on pixel width /to various browser versions /to various operating systems. (Wired Monkey did a great article on this, I'll try to find it and post).

Does your BG need to be full screen width and height; OR is it a graphic that needs to be 100% for every screen and does not need the height? I'd be looking at using table widths if it is the latter; creating the effect of running fill width -- regardless of the browser in use.

One trick that's good to try is, if the layout supports this, create a 100% table for the overall layout; place the image as a BG within that table. This will be a bit more challenging if you also need to have fixed widths within some td cells for other elements. But doable :). With tweaking :). Don't go more than 4 nested tables, your page will just hang in, for example, NN 4+.

JT / WW
 
Dwarfthrower:

Script. Handy.

We generally try to code with the assumption that a lot of people do turn their JavaScript off. What's your option for no script?
 
>> What's your option for no script?

No stretched background image.

Javascript off = don't get to see cool javascript widgets.

It's all fluff anyway, I don't think anyone will kill themselves over not being able to see a background image.


[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top