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 12 of 12
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts

    background-color not validated ?

    Hi

    I have used the style below for the div #indexcontainer but when I check it with the w3c validation service it gives me the following error: URI : style.css
    35 a:link Value Error : background Parse Error color:rgb(192,192,192)

    I am following a sitepoint book which gives me examples using this background-color style rule and so I am confused about why it is coming up as invalid. There is nothing wrong with how my document looks as it applies the style and it looks exactly as I want it but I can't understand why the w3c will not validate it ? Any thoughts ?

    Code:
    #indexcontainer {
    background-color: #424242;
    padding-top: 5px;
    padding-right: 50px;
    padding-bottom: 20px;
    padding-left: 20px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 800px;
    height: 500px;
    }

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    There's nothing wrong with that css. What statement comes before what you've posted?

  • #3
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SB65 View Post
    There's nothing wrong with that css. What statement comes before what you've posted?
    Sorry! We found the following errors (1)
    URI : style.css
    35 a:link Value Error : background Parse Error color: rgb(192,192,192)

    Then if I click on the word 'background' from the above I get this:

    'background'
    Value: [<'background-color'> || <'background-image'> || <'background-repeat'> || <'background-attachment'> || <'background-position'>] | inherit
    Initial: see individual properties
    Applies to: all elements
    Inherited: no
    Percentages: allowed on 'background-position'
    Media: visual
    Computed value: see individual properties

    The 'background' property is a shorthand property for setting the individual background properties (i.e., 'background-color', 'background-image', 'background-repeat', 'background-attachment' and 'background-position') at the same place in the style sheet.

    Given a valid declaration, the 'background' property first sets all the individual background properties to their initial values, then assigns explicit values given in the declaration.

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,332
    Thanks
    5
    Thanked 363 Times in 360 Posts
    You don't have a embedded style do you?

  • #5
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    What I mean is, what comes before the css statement that's giving you the problem in your css. Is it a:link by any chance? Can you post all your css?

  • #6
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SB65 View Post
    What I mean is, what comes before the css statement that's giving you the problem in your css. Is it a:link by any chance? Can you post all your css?
    Nothing. That is everything that is there at the top of the result page. All of my styles are on one separate style sheet.

  • #7
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    No, no. In your stylesheet, what comes before the statement for #indexcontainer. Can you post your whole stylesheet?

  • #8
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Strange I just went to the bottom of the results page and found my code under 'Valid CSS information' and found this, below, which as far as I can see is the same as what I already have ?

    Code:
    #indexcontainer {
    background-color : #424242;
    padding-top : 5px;
    padding-right : 50px;
    padding-bottom : 20px;
    padding-left : 20px;
    margin-top : 20px;
    margin-left : auto;
    margin-right : auto;
    width : 800px;
    height : 500px;
    }

  • #9
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Code:
     body {
          color:#BDBDBD;
          font:x-small/1.5em Georgia,Serif;
          voice-family: "\"}\""; voice-family:inherit;
          font-size:small;
          }
        
    #logo {
    	position: relative;
    	padding-top: 10px;
    	margin-left: 175px;
    }
    
    #indexcontainer {
    background-color: #424242;
    padding-top: 5px;
    padding-right: 50px;
    padding-bottom: 20px;
    padding-left: 20px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 800px;
    height: 500px;
    }
    
    a{
    text-decoration: none;
    }
    a:link {
    color:white;
    background color: rgb(192,192,192);
    }
    
    a:visited {
    color: #FFFFFF;
    }
    
    a:hover {
    color: #FFFFFF;
    background-color: rgb(192,192,192);
    }
    
    #indexcontainer img {
    float: left;
    margin-top: 5px;
    margin-right: 20px;
    margin-left: 5px;
    }
    
    #nav {
    font-family: Arial, Helvetica, sans-serif;
    font-size: .9em;
    }
    
    #nav ul {
    list-style: none;
    margin-top: 5px;
    margin-left: 370px;
    margin-bottom: 10px;
    padding: 0;
    padding-top: 4px;
    }
    
    #nav li {
    display: inline;
    }
    
    #nav a:link, #nav a:visited {
    padding: 3px 10px 2px 10px;
    color: #FFFFFF;
    background-color: #424242;
    text-decoration: none;
    border: 1px solid #BDBDBD;
    }
    
    #nav a:hover {
    color: #FFFFFF;
    background-color:  rgb(192,192,192);
    }
    
    /*Ray starts*/
    
    #raycontainer {
    background-color: #424242;
    padding-top: 5px;
    padding-right: 50px;
    padding-bottom: 20px;
    padding-left: 20px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 800px;
    height: 650px;
    
    }
    
    #raycontainer img {
    float: left;
    margin-top: 10px;
    margin-right: 23px;
    margin-bottom: 5px;
    margin-left: 5px;
    }
    
    /* Uilleann Pipemaker Starts*/
    
    /* Irishpic.gal starts*/
    
    #pageheader {
    clear: left;
    width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0px 0px 0px 0px;
    color: #BDBDBD;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    }
    
    #pageheader h1{
    text-align: center;
    font-size: 1em;
    font-family: Arial, Helvetica, sans-serif;
    }
    
    #pageheader h2{
    text-align: center;
    margin-top: 5px;
    font-size: 1em;
    font-family: Arial, Helvetica, sans-serif;
    }
    
    
    #irishpiccontainer {
    background-color: #424242;
    padding-top: 5px;
    padding-right: 50px;
    padding-bottom: 50px;
    padding-left: 20px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 1150px;
    height: 800px;
    
    }
    
    #table1 {
    margin-left: 200px;
    }
    
    #table3 {
    margin-left: 80px;
    }
    
    #table6 {
    margin-left: 70px;
    }
    
    #table2 {
    margin-left: 40px;
    }
    
    #table5 {
    margin-left: 35px;
    }
    
    #table4 {
    margin-left: 12px;
    }
    
    #table7 {
    margin-left: 0px;
    }
    
    /*SSP*/
    
    #sspcontainer {
    width: 750px;
    height: 700px;
    color:#BDBDBD;
    background-color: #424242;
    margin-top: 20px;
    margin-right: auto;
    margin-bottom:50px;
    margin-left: auto; 
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 30px;
    padding-top: 10px;
    font-family: Arial, Helvetica, sans-serif;
    }
    
    #scotsection2 {
    list-style-type: none;
    }
    
    #scotsection2 li{
    float: left;
    margin-right: 30px;
    }
    
    #scotsection2 img {
    display: block;
    border: none;
    margin-bottom: 100px;
    }
    
    #survivalguide {
    position: absolute;
    width: 700px;
    padding: 0px;
    margin-top: 200px;
    margin-left: 30px;
    padding: 10px;
    }
    
    #survivalguide img {
    float: left; 
    padding-top: 10px;
    padding-right: 10px;
    padding-bottom: 0px;
    padding-left: 0px;
    }
    
    /* Bellows */
    
    #belscontainer {
    width: 700px;
    height: 700px;
    color:#BDBDBD;
    background-color: #424242;
    margin-top: 20px;
    margin-right: auto;
    margin-bottom:50px;
    margin-left: auto; 
    padding-top: 10px;
    padding-right: 30px;
    padding-left: 30px;
    font-family: Arial, Helvetica, sans-serif;
    }
    
    #bellspageheader {
    margin-left: auto;
    margin-right: auto;
    padding: 0px 0px 0px 0px;
    color: #BDBDBD;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    }
    
    #bellscontact {
    text-align: center;
    }
    
    #bellspic1 {
    margin-left: 140px;
    }
    
    #bellspic1 img {
    border: none;
    }
    
    #bellspic2 {
    margin-left: 210px;
    }
    
    
    /* style for LINKS page starts */
    
    #linkscontainer {
    background-color: #424242;
    padding-top: 5px;
    padding-right: 50px;
    padding-bottom: 20px;
    padding-left: 50px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 800px;
    height: 2000px;
    
    }
    
    #linkscontainer a:visited {
    color: #FFFFFF;
    background-color: rgb(192,192,192);
    border: 1px solid #BDBDBD;
    }
    
    /* Prices */
    
    #pricescontainer {
    background-color: #424242;
    padding-top: 5px;
    padding-right: 50px;
    padding-bottom: 20px;
    padding-left: 50px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 800px;
    height: 1700px;
    
    }
    
    /* style for Sounds page starts */
    
    #sounds ul{ 
    margin-top: 100px;
    margin-left: 300px;
    padding: 0px;
    margin-bottom: 20px;
    }
    
    #sounds li{
    list-style-type: none;
    font-family: Arial, Helvetica, sans-serif;
    display: inline;
    text-align: center;
    }
    
    #sounds a{
    font-size: 1.1em;
    color: #BDBDBD;
    padding: 5px;
    background-color: #424242;
    border:solid 1px;
    text-decoration: none;
    margin-right: 10px;
    }
    
    #sounds a:hover
    {
    background-color: #FFFFFF;
    color: #424242;
    }

  • #10
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    There's your problem:

    Code:
    a:link {
    color:white;
    background color: rgb(192,192,192);
    }
    No hyphen. Which is what the error says:

    35 a:link Value Error : background Parse Error color: rgb(192,192,192)

    Line 35 - a:link
    value error: background
    parse error: color:rgb(192,192,192)
    Last edited by SB65; 10-28-2010 at 08:38 PM.

  • Users who have thanked SB65 for this post:

    webdiv (10-28-2010)

  • #11
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh **** - I didn't see that ! Sorry. I have just started using the validator and didn't quite understand the info'....

    Thanks again SB65 you're a Godsend !

  • #12
    New Coder
    Join Date
    Nov 2006
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SB65 View Post
    There's your problem:

    Code:
    a:link {
    color:white;
    background color: rgb(192,192,192);
    }
    No hyphen. Which is what the error says:

    35 a:link Value Error : background Parse Error color: rgb(192,192,192)

    Line 35 - a:link
    value error: background
    parse error: color:rgb(192,192,192)
    Hey SB65 it's all just been validated - great stuff, thanks again !


  •  

    Posting Permissions

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