View Full Version : Backround image

Jul 2nd, 2002, 02:43 PM
Hello all!

I'm making a website, and at the index it redirect different resulution users to different pages. But when i insert the background image it doesn't fit!!!

I've done the bg image in Adobe Photoshop 7.0, for ex. 1600 * 1200 in adobe don't fit the screen in explorer. What size is it in explorer please help me!!:confused:

Plz give the sice for

800 * 600
1024 * 768
1152 * 864
1240 * 1024
1600 * 1200

Jul 2nd, 2002, 03:14 PM
That's 'cos you have to take into account that browser windows have tool bars, address bars etc along the tops and bottoms, which means a window will never be at full size (even with F11).

I suggest you click Print Screen, paste onto a new Photoshop layer, crop out the tool bars and then look at the image size - then you'll find out the window size!
Sorry I don't know a quicker way to do this, but everyone's browser windows will vary.

Jul 2nd, 2002, 03:39 PM
you should make the image huge (like 1600*1200) and then have this at the top of you page


function changepicsize()
backg.width = screen.availWidth;
backg.height = screen.availheight;

<body onload="changepicsize()">
<img name="backg" src="back.gif" style="position: absolute; top:0px; left: 0px;z-index:2;">
<div style="z-index:1;">
the rest of the page

this isnt very good if your page is a dhtml intensive page

Jul 2nd, 2002, 03:55 PM
and if you want the image hit the edge of the screen without the little white border put these in the <body>tag


or you can use just one or two of them, i.e.

<body bgcolor="#000000" topmargin="0" bottom margin="0">

blah blah blah



Quiet Storm
Jul 2nd, 2002, 06:27 PM
For all your background sizing problems... :D

Use this code:


NS4 = (document.layers);
IE4 = (document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = "your-image.jpg";
if (NS4) window.onload = setResize;
function setResize(){
function reDo(){
if (IE4) window.onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight;
function makeIm() {
winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight;
imStr = "<DIV ID=elBGim"
+ " STYLE='position:absolute;left:0;top:0;z-index:-1'>"
+ "<IMG NAME='imBG' BORDER=0 SRC=" + imSRC;
if (scaleWidth) imStr += " WIDTH=" + winWid;
if (scaleHeight) imStr += " HEIGHT=" + winHgt;
imStr += "></DIV>";


<SCRIPT LANGUAGE="JavaScript1.2">

... the rest of your content...