treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Multiple Backgrounds

  • 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?
  • 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;
    }
  • Move the main-bg from the body to the html, and the interior to the body and so on.