Background color for a div

Discussion in 'HTML & Website Design' started by mmbus, Sep 25, 2012.

  1. #1
    Okay, the best example of what I'm asking is the google adsense located at the bottom of this post. Take a look and then come back up here.


    Basically, I put a leaderboard ad on the footer of one of my sites, right under a menu. But the menu is significantly wider than the leaderboard. So to make it look less tacky, I tried to put a white background behind the leaderboard so that viewers would see white space on either side of the ad (right now, it's show a background image). Everything I tried did not work so I'm obviously missing something.

    How can I get a specific color to appear behind the ad?
     
    mmbus, Sep 25, 2012 IP
  2. wyeoh

    wyeoh Greenhorn

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #2
    Give your div an id and style it using css.
    For example <div id="leaderboard"></div>

    and then in your stylesheet, simply do
    #leaderboard{
    background-color:#fff;
    }

    note: #fff is the hex color for white.
     
    wyeoh, Sep 25, 2012 IP