webdiv 10-28-2010, 07:57 PM 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 ?
#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;
}
There's nothing wrong with that css. What statement comes before what you've posted?
webdiv 10-28-2010, 08:13 PM 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.
teedoff 10-28-2010, 08:13 PM You don't have a embedded style do you?
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?
webdiv 10-28-2010, 08:27 PM 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.
No, no. In your stylesheet, what comes before the statement for #indexcontainer. Can you post your whole stylesheet?
webdiv 10-28-2010, 08:32 PM 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 ?
#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;
}
webdiv 10-28-2010, 08:34 PM 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;
}
There's your problem:
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)
webdiv 10-28-2010, 09:04 PM 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 !
webdiv 10-28-2010, 09:08 PM There's your problem:
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 !
|
|