Background Help

They have: 14 posts

Joined: Sep 2003

Hi, how do i make it where my background image isn't tiled, i just want my background image to fit any browser, and i want it where the image isn't cut off? How can i do this?

Busy's picture

He has: 6,151 posts

Joined: May 2001

the only way to make it fit every screen size is to have it tiled, and the image has to be a minimum of 1300 wide if it's a design, plain patterns can be 100x100.

If you want a design (a picture or something) the only way is to set it in the middle of the screen and either tile it in the background for added effect (use tables) or set the image in the center and use bgcolor for the extra space on big screens (CSS). you'd have to make your background image for 800x600 size if fixed and hope the smaller screen sizes dont mind and the bigger ones get it centered.
Welcome to the fun of a multi sized world

He has: 69 posts

Joined: Oct 2003

to just make it to where it doesn't tile.. in the body tag you can just add

Quote: bgproperties="fixed"

I don't know about making that fit on every browser though.

Busy's picture

He has: 6,151 posts

Joined: May 2001

bgproperties isn't a universal thing (wont work in all browsers), you can fix it with CSS which is a little more universal but if it's an image will be cut off in smaller screen sizes and will have blank areas in larger

They have: 14 posts

Joined: Sep 2003

can someone list me all the web browser size, so i can resize my image to fit the different sizes?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Nimrod, that's a really bad idea.

For instance, while my monitor is set to 1200x1000 something or other, my browser is currently somewhere between 800 and 900 wide and tall equally.

You just cannot determine what an end user is doing.

Post a link to the mockup and we can give you some better ideas on how to make it work across different sizes and resolutions.

Busy's picture

He has: 6,151 posts

Joined: May 2001

to add to what Suzanne mentioned, some people have their tool bars on the side instead of top and bottom

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

Busy wrote: to add to what Suzanne mentioned, some people have their tool bars on the side instead of top and bottom

How about innerHeight, innerWidth, ClientHeight and ClientWidth?

Shakespeare: onclick || !(onclick)

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

It's not worth writing a massive DOM hack to do this...As Suzanne said:

Quote: You just cannot determine what an end user is doing.

It would be a pain and you can guarantee it'll be easily broken - as all hacks are Smiling It would be far easier to use CSS:

body {
background-image: url(bg.jpg);
background-repeat: no-repeat;
}

a Padded Cell our articles site!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Using JavaScript to read what the enduser has is fine, but the problem comes in when you try to match that with endless versions of your site. Smiling

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

Suzanne wrote: Using JavaScript to read what the enduser has is fine, but the problem comes in when you try to match that with endless versions of your site. Smiling

yep, that's a real pain in the *** Smiling

Shakespeare: onclick || !(onclick)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.