PDA

View Full Version : Gradient Woes



FlasH
23-01-11, 15:18
Trying to make a quick mockup of a website for my Dad, trying to get a gradient as a background from blue to dark blue which would be fixed. How would I go about this for different resolutions though?

Dukey
23-01-11, 17:12
Doesn't sound like an easy thing to do for all browsers + resolution combinations...

Perhaps going old-school and using a background image few px. wide, with
background-repeat: repeat-x

This wouldn't work too well with different viewport heights (I don't think) so maybe use some javascript in the HTML head to choose from a few different height gradient images, using this kinda thing:

newImage = "url(images/image1024.gif)";
document.getElementById('background').style.backgr oundImage = newImage;

Seems like a really dirty way of doing it though, sure others will have better ideas.