Get a free trial // Grow your CSS skills // Land your dream job

CSS background color disappears when ad image

  • # June 12, 2009 at 10:10 pm


    here is a sample of the CSS involved, i’ve set the background color with CSS & then want to have an image in the top right corner, but when i ad the image the CSS color disappears & i’m left with plain white. Is there something i can do to stop this from happening?

    #page-wrap {
    background-color: #333333;
    width: 100%;
    margin: 0 0 0 0px;
    padding: 15 15 15 15px;
    border-width: 1px;
    border-style: solid;
    border-color: grey;
    background: url(images/air.jpg) no-repeat right top;


    # June 13, 2009 at 1:40 am

    This is how I would write it:

    #page-wrap {
    background: #333 url(images/air.jpg) no-repeat right top;
    width: 100%;
    margin: 0;
    padding: 15px;
    border: 1px solid grey;

    Do you have a link?

    # June 13, 2009 at 4:01 am


    i fixed issue thanks, i figured since the CSS is it’s own property, i would need to embed the image through html & it worked fine, got flash embeded + video exactly the same way :D

    # June 14, 2009 at 7:45 pm

    In any event, you’ve overwritten your initial background-color property when you write the subsequent background. By not specifying a color in your background property, you’ve effectively reset it to transparent.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed