| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: May 2008
Posts: 13
|
CSS help-Two backgrounds on a blog
I am trying to add not only a content background, but also a main background image. I tried stacking them with the z index, but I do not want the position to be absolute. Any suggestions? Still learning CSS so work with me Thanks in advance for any help!! (Need more info? Just smack me and ask |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: May 2008
Location: Seattle
Posts: 64
|
Yep, we will need to know more about what you want to achieve. The most common scenario would be something like this: Code:
Code:
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: May 2008
Posts: 13
|
Thanks much! Here is what I have so far...the content area has a background but it seems there is a separate area for the header. I have just confused myself. LOL body { background: #a78a9e url(images/content.gif) top center repeat-y; color: #333333; font-size: 11px; font-family: Century Gothic; margin: 0px auto 0px; padding: 0px; } #wrap { background: url(images/bg.gif) top center repeat-y; color: #333333; font-size: 11px; font-family: Century Gothic; margin: 0px auto 0px; padding: 0px; } So basically what I want to do is have an image for the content area then have a background image for the overall site, but they won't seem to stack. One either replaces the other. |
|
|
|
#5 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,007
|
You probably need to declare a width for your #wrap. Assuming the only thing containing it is the body, right now it is extending to the full width of its container, which would be the whole width of the screen. That's why you can't see the body's background. This space for rent.
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: May 2008
Posts: 13
|
Brilliant! Thank you all so much for your assistance. I look forward to being around here and learning more! Cheers!! Here is the final code I used: body { background: #a78a9e ; background-image:url(images/bg1.jpg); background-attachment: fixed; color: #333333; font-size: 11px; font-family: Century Gothic; margin: 0px auto 0px; padding: 0px; } #wrap { background: url(images/bg.gif) top center repeat-y; width: 950px; color: #333333; font-size: 11px; font-family: Century Gothic; margin: 0px auto 0px; padding: 0px; } |
|
![]() |