Thread: css warning

    #1
  1. No Profile Picture
    Give peace a chance.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Buenos Aires, Argentina
    Posts
    83
    Rep Power
    15

    Question css warning


    Can anybody explain me this css warnings ?
    * Line : 20 Level : 1 You have no color with your background-color : .menu
    * Line : 30 Level : 1 You have no color with your background-color : .langch
    * Line : 42 Level : 1 You have no color with your background-color : .rightbar
    * Line : 56 Level : 1 You have no color with your background-color : .contents
    * Line : 152 Level : 1 You have no color with your background-color : .btmbtn

    thank you
  2. #2
  3. No Profile Picture
    The Architect
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Orb-3
    Posts
    16
    Rep Power
    0
    Might be able to help.
    More details requested.
    What causes you to get this message?
  4. #3
  5. No Profile Picture
    Give peace a chance.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Buenos Aires, Argentina
    Posts
    83
    Rep Power
    15
  6. #4
  7. No Profile Picture
    Idiota de la aldea
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    39
    Rep Power
    14
    I believe that they are warnings for if you do not specify font color in your css:

    * Line : 20 Level : 1 You have no color with your background-color : .menu

    means no font color designation in the following portion of the example code

    Code:
    .menu {
    background-color : #c4ffff; 
    text-align : center; 
    padding-top : 2px; 
    padding-right : 2px; 
    padding-bottom : 2px; 
    padding-left : 2px; 
    }
    That's just my take on it but I may be wrong because it's all speculation
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    Common practice is to assign both a color to the text if you assign a custom background color. You didn't, so the validator issues the warning.

    Its not an error though, since the document is valid. But some browsers may not inherit the base text color when you override with your .menu style. This may result in the text not being visible, depending on what the client's browser is set to for default text color. Basicaly, for ever background-color: #xxxxxx;, you should also have a color: #xxxxxx; statement, even if it reproduces a color that should have been inherited from the base style. Just safe css practice.
  10. #6
  11. No Profile Picture
    Idiota de la aldea
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    39
    Rep Power
    14
    ^^Rapid fire responses
  12. #7
  13. No Profile Picture
    The Architect
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Orb-3
    Posts
    16
    Rep Power
    0
    I tend to agree with MJEggertson. If this is actually the case, then it is good CSS practice to assign values to the styles you set.
  14. #8
  15. No Profile Picture
    The Architect
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Orb-3
    Posts
    16
    Rep Power
    0
    On the other hand however, the usual default background-color is #ffffff. If you do not specify a color to be employed, whether it be for the background, or for the fonts used, or for anything else for that matter, the browser should automatically display the default color(s). With that in mind, i do not follow why you would recieve the message that you did/do. Interesting quandry.

IMN logo majestic logo threadwatch logo seochat tools logo