Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS background color not showing up?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28613
    threedash
    Member

    hi.

    threedash.com/morro

    this is a test site i am working on and for some reason, the BG color doesn’t show up?

    help please.

    #73366
    blue642
    Member

    that is because you have set the background color, and then overwritten it by using the background shorthand….

    either move the background-color call after the background shorthand, or add it TO the shorthand…

    Code:
    body {

    margin: 0;
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    background: url(image/marble.jpg) no-repeat;
    background-position: center 32px;
    background-color: #f4efe3;
    }

    OR—-

    body {

    margin: 0;
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    background: url(image/marble.jpg) #f4efe3 no-repeat;
    background-position: center 32px;
    }

    the browser interprets your current code like this…

    Code:
    background: url(“image/marble.jpg”) no-repeat scroll center 32px transparent;

    notice the transparent…. (because you didn’t specify, that is the default…)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.