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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gradient Background

Status
Not open for further replies.

jkmitchell

Programmer
Aug 9, 2001
39
GB
Hi,

I have a client who is insisting on a vertical gradient background (from white to blue down the page).

Even with tiling the image horizontally I can see that there is going to be a problem with this on different screen sizes, can anyone think of a solution ? I don't really want to have to generate many images depending on the height of the window but will have to if there is no other way.

Cheers

John
 
Hi mate,

You could make an image say 25 x 2000px and that should stop it tiling on a larger screen resolution but then you are stuck when your page content exceeds 2000px.

If you make it larger, then the image will not tile but all your visitors no matter what resolution, will have to load the full size image..

You could make the image larger than the top resolution and then make it a fixed background, but then the gradient will be different in every resolution.

I think this would just be a trial or error situation..

Hope this helps Wullie

 
Hi Wullie,

This is what I was thinking, all I suspect I can do is to force the screen width to fit an 800 x 600 screen and then have different backgrounds for each page depending on the length.

Of course, if I could convince the client not to have this background it would be easier, the problem being they are a print firm and I had a real job convincing them that they didn't need an 'exit from this web site' button ;-)

Thanks for your comments.

Regards

John
 
Hi mate,

I am not sure what you mean about forcing the width...

If you use a tiled background as I mentioned in the last post, you should be ok no matter what width the screen is. It should tile to fit.. It will be the height that is the problem.

How many pages is this site going to have?

Seems a lot of work for a background image. Doing it this way, if you want to add a new paragraph to the page you will need to either scale the existing image or create a new one.

BTW. Why did they feel the need for an exit button? Do they ever use the internet? [hammer]

Hope this helps Wullie

 
jkmitchell,

Why don't you use two tables (one on top of each other). The top table would have the gradient and sized lengthwise for the bg image (have the gradient cover 2/3 of the screen), and the second table set the bg color to white?

Maybe this helps?

AJ
 
Hi Wullie,

Sorry, I meant that I could set the page width to fit an 800 pixel screen (and maybe centre it if the screen is wider then 800).

I agree about tiling, and as the site is only about 10-12 pages it might be easiest to create a background for each page (as long as I know the length - which of course can change depending on the width).

Ah yes, the exit button - I asked the client where they would like the visitor to go when this was clicked on (ie where were they going to send them) and I could see the light dawning in their eys. Mind you this was after I talked them out of having just a 'next page' button on each page "we know where you want to go on our site and we are going to make sure you visit it in the order we want" ;-)

Some clients you can do without - mind you in a way it's nicer than the one that contact you and says "how much is a web site?". They had at least thought about what they wanted.

Cheers

John

 
Hi mate,

The best way I can see for you to do this is to redirect the user based on resolution..

Would be more work but the only actual difference between the pages would be the background images..

So in this senario, the user enters the site to a redirect page, the user won`t actually know they are being redirected...

They are then sent to a certain directory based on the resolution.

To create the extra directories, you don`t actually have to change any of the code in the actual different "resolution directories", all you have to do is to replace the background images in each directory with the appropriate one for that resolution.

So it is just a case of having a few identical directories with the exception of the background image in each..

BUT, this means that if there is a change to the content, you will have to copy that directory and rename it again for the other resolutions. Not difficult and as you say it is only about 12 pages you also wouldn`t have to worry about server space etc because of these identical directories..

As for the clients.. [cannon]

Hope this helps Wullie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top