Treehouse: Grow your CSS skills. Land your dream job.

Multiple Backgrounds

  • # June 6, 2010 at 6:34 pm

    Hey there, I’ve got a background for my page that I want repeated, which I’ve placed in the body style.

    I’ve got another background (sort of like a glow) I would like to place over it, just once in the middle of the page.

    How would I accomplish this?

    # June 6, 2010 at 7:04 pm

    Add a new div or element inside.

    For example;
    The repeating background could be the body background, then add a new div with a id

    body {
    background: url(“images/main_bg.jpg”) repeat #000;

    div#interior {
    width: ___px;
    height: ___px; (or leave blank for auto)
    margin: 0px auto;
    background: url(“images/interior_bg.jpg”) no-repeat center top #555;

    # June 8, 2010 at 7:27 pm

    Move the main-bg from the body to the html, and the interior to the body and so on.

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

You must be logged in to reply to this topic.