Jump to content

Background Image


holmedwa04

Recommended Posts

Hi AllJust a really quick one, this is the code that is used to display a background image, but when viewed on a big resolution it repeats vertically, is there any way of getting it to stretch vertically no matter how long the page is and repeat horizontally?

body {background-image:url('../images/Gradient.gif');repeat-x;color: #000000;margin:0px;padding:20px;text-align:center;}

Thanks in advance.

Link to comment
Share on other sites

Ok, sorry will change that, do you know what code I should use to get it to stretch vertically though?EDIT: I think I may have worked it out... set the vertical repeat to none, and then set the background colour of the page to that of the bottom colour of the gradient image. This way it doesn't stretch the image :) This should work I think.EDIT 2:Ok this is what I have come up with...

body{ background-image: url('../images/Gradient.gif');background-repeat: repeat-x;background-color: #003398}

Link to comment
Share on other sites

Sorry. I guess I didn't read your whole post. You are correct, setting the background-color to match the bottom of the gradient is the "standard" way of achieving that effect. You wouldn't want a "stretch" anyway, since it would eventually create a banded effect.

Link to comment
Share on other sites

Sorry. I guess I didn't read your whole post. You are correct, setting the background-color to match the bottom of the gradient is the "standard" way of achieving that effect. You wouldn't want a "stretch" anyway, since it would eventually create a banded effect.
Yes quite right, I doubt the pages are going to be a huge size but I see what you are saying.Sorry for making such a silly topic, I just needed a reply quickly! :) And then it came to me. :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...