Can I use both image and color backgrounds?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Haitashi
    New Member
    • Jun 2007
    • 96

    Can I use both image and color backgrounds?

    I'm having a bit of confusion. Hopefully someone can help.

    I want to create a box that has an image on the top and has a color background.

    Code:
    .greenHeader {
    	background-image: url(images/0t1.jpg);
    	background-repeat: no-repeat;
    	vertical-align:top;
            background-color:#E6EED7;
    }
    What I'm getting from what I pasted above is just the BG color. The background-image property gets completely ignored.

    Thanks in advance! ^_^
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    This worked for me. I would suggest that you make sure that the path to the images directory is correct.

    [CODE=css]body {
    background-color: blue;
    background-image: url(bg.jpg);
    background-repeat: no-repeat;
    }[/CODE]

    --Kevin

    Comment

    • Haitashi
      New Member
      • Jun 2007
      • 96

      #3
      I don't know if this was why it wasn't working for me but I moved around the properties to match the same order you have your properties setup (placing the background-color attribute before the background-image). Now seems to work fine. Thanks!

      Comment

      Working...