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

Background image + background colour?

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Looking to have a 1px wide gradient image with say 150px height repeating across the page left to right plus a background colour that is the same colour as the colour seen at the bottom of the gradient image.

In faq215-2573 Body Background CSS there exists
Code:
<style type="text/css">
<!--
body {
    background-attachment: fixed;
    background-image: url(file);
    background-repeat: no-repeat;
    background-position: left top;
}
-->
</style>

What mods to the code are suggested to achieve the result and is the concept expressed in the first para the best way to go?

TIA


FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander.com
PDFcommander.co.uk
 
You can also do it all with the background shorthand. I would drop the background-attachment though, because I don't know if you want it fixed.
Code:
body {
  background: #abc url(myImage.jpg) 0 0 repeat-x;
}
 
No, this is about the best way to do what you want to do. Can't really see how anything could be better than that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top