Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2004
    Location
    near the only active volcano in the continental US
    Posts
    409
    Thanks
    6
    Thanked 2 Times in 2 Posts

    CSS Validation Warnings

    I've been working to validate my CSS through W3C and though it validates as good, it does give me some warnings and I am a bit confused as to how to interpret these warnings. For example, if I have the following code in the style portion of my page;

    Code:
    body {
    background-image: none;
    background-color: #ffffff;
    margin: 5px;
    }
    
    td.something {
    background-image: none;
    background-color: #ffffff;
    border-color: #000000;
    border-width: 1px;
    border-style: solid;
    vertical-align: middle;
    text-align: center;
    font-style: normal;
    font-size: medium;
    font-weight: bold;
    color: #000000;
    font-family: "Tahoma";
    }
    
    p {
    background-color: transparent;
    margin: 1%;
    font-style: normal;
    font-size: small;
    font-weight: normal;
    color: #000000;
    font-family: "Tahoma";
    }
    I get the following warnings;

    Line : 18 (Level : 1) You have no color with your background-color : body
    Line : 51 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : td.something
    Line : 60 (Level : 1) You have no background-color with your color : p
    Some of these warnings (like the one for generic font family) I understand. However, the warnings about no background-color are leaving me a bit confused. I've tried using all UpperCase letters as well as all LowerCase letters and I still get the same warnings. Can someone explain this to me please.

    GW

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Use background:none; instead
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Nov 2004
    Location
    near the only active volcano in the continental US
    Posts
    409
    Thanks
    6
    Thanked 2 Times in 2 Posts
    I am assuming you mean that it should look like this instead?

    Code:
    body {
    background: none;
    margin: 5px;
    }
    And so on?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    body {
    background-color: #ffffff;
    color: #000000; /*The validator is giving you a warning about not having a color in your body so put one*/
    margin: 5px;
    }
    
    td.something {
    background-color: #ffffff;
    border-color: #000000;
    border-width: 1px;
    border-style: solid;
    vertical-align: middle;
    text-align: center;
    font-style: normal;
    font-size: medium;
    font-weight: bold;
    color: #000000;
    font-family: "Tahoma";
    }
    
    p {
    background:none;
    margin: 1%;
    font-style: normal;
    font-size: small;
    font-weight: normal;
    color: #000000;
    font-family: "Tahoma";
    }
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    near the only active volcano in the continental US
    Posts
    409
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Gotcha!

    Thanks

    GW


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •