I was just wondering how to make a background image repeat at the top of the site only.
Like the yellow gradient used at the top of http://www.cnet.com.
CSS Background Repeat at top
Moderator: General Moderators
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Code: Select all
background:url('gradient-image.png') repeat-x;I found this piece of code to work perfectly as needed.
Code: Select all
body {
background-image: url("images/fixed_bg.gif");
background-position: top;
background-repeat: repeat-x;
background-attachment: fixed;
}-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
With the exception of the background-attachment property, what you just posted there will work identically to the code that aaronhall posted...icesolid wrote:I found this piece of code to work perfectly as needed.
Code: Select all
body { background-image: url("images/fixed_bg.gif"); background-position: top; background-repeat: repeat-x; background-attachment: fixed; }