What is wrong with this?
this error is from the W3C validator -
Line Description
6 Parse Error body { font-family:Verdana, Arial, Helvetica, sans-serif; background-color:white; }
174 Parse Error
It seems to work on one of my sites.
Do you have a missing before that line? Quite often a previous tag will not be ended correctly and cause others after it to fail.
You show line 6 and 174. So, the missing 168 lines could have a bad tag or an extra “/” somewhere causing the error.
Hi Ernie,
I have double checked the entire 183 or whatever lines of css and it appears there is no missing tags of any kind. No accidentally substitured parenthesis for curly braces, or semi-colons/colons mixed up. I don’t see anything wrong. Below is the entire styles.css -
<style>
html {
height:100%;
}
* {
margin:0;
padding:0;
}
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
background-color:white;
}
h1, h2, h3, h4, h5, h6 {
font-family:Verdana, Arial, Helvetica, sans-serif;
}
p, ul, li, span {
font-family:Verdana, Arial, Helvetica, sans-serif;
line-height:1.5em;
color:black;
padding:0 0 20px 0;
}
a {text-decoration:none;}
a:link {color:darkgreen;}
a:visited {color:black;}
a:hover {color:green;}
a:focus {color:black;}
a:active {color:green;}
#ad_1 {
position: fixed;
z-index:5;
top: 0;
left: 0;
width: 130px;
height: 700px;
padding: 0 0 0 10px;
background:white;
}
#menubar {
z-index:2;
position: fixed;
top: 100px;
left:140px;
width:700px;
height:30px;
padding: 5px 15px 5px 15px;
background:green;
}
#header {
z-index:1;
position: fixed;
top: 0;
left:140px;
width:700px;
height:80px;
padding: 20px 0 0 80px;
background:green;
}
#ad_2 {
position: fixed;
top: 0;
left: 1070px;
width: 130px;
height: 700px;
padding: 0 0 0 10px;
background:white;
}
#sidebar {
z-index:4;
position: fixed;
top: 0px;
left: 870px;
width: 190px;
height:960px;
padding: 0 0 0 10px;
background:white;
}
#recent {
z-index:3;
position:fixed;
top:150px;
left:660px;
height:400px;
background:white;
padding:10px 10px 10px 10px;
width:190px;
}
#bottom {
position: fixed;
bottom: 0px;
left:0px;
width:1200px;
height:25px;
margin:0 0 0 0;
padding: 5px 5px 5px 5px;
background:white;
text-align:center;
color:black;
}
#bodytext {
font-family:Verdana, Arial, Helvetica, sans-serif;
z-index: 0;
position: absolute;
top:140px;
left:140px;
width:500px;
height:480px;
background-color:#ccff99;
padding:10px 10px 10px 10px;
margin: 0 0 0 0;
overflow:auto;
}
ul {
list-style-type: none;
height: 30px;
width: 620px;
margin: auto;
}
li, dt {
float: left;
list-style-type:none;
}
ul a {
padding-right: 15px;
padding-left: 20px;
display: block;
line-height: 30px;
text-decoration: none;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
dl a {
padding-right: 0px;
padding-left: 0px;
display: block;
text-decoration: none;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:85%;
}
a.light:link {
color: lightgreen;
text-decoration: none;}
a.light:visited {
color: lightgreen;
text-decoration: none;}
a.light:hover {
color: white;
text-decoration: none;}
a.light:focus {
color: lightgreen;
text-decoration: none;}
a.light:active {
color: lightgreen;
text-decoration: none;}
.white {
color:white;
font-size: 200%;
}
.yellow {
color:yellow;
font-size:200%;
}
</style>
Here’s what I just did and it now validates - in the validator results window it shows the correct valid css. From what I can see the only difference it does not include the first
html {height:100%;}
section. Without that it validates fine. I don’t see anything else that might be wrong, but something must be, I am pretty sure that section is okay.
Hmmm, interesting…
I have it on one of my test sites and it seems to be okay.
I also read on a site that you can use:
body, html {
height: 100%;
padding: 0;
}
Which seems to validate on my site. This site noted that you should make your container inside that one to be slightly less that 100% to fix scrolling issues? Not important here…
On another site there was mention of the type of “doctype” being important.
Seems that the W3 validator will validate differently when you use different doc types.
Some are more exact than others and some are more flexible. The one I am using on my test site is:
[php]
[/php]Not sure if that helps… Another idea, if you move the 100% to tag instead of does it make a difference?
Seems like you found another good puzzler…
Thanks for the reply. I changed the body section to this in the file -
body, html {
height: 100%;
padding: 0;
font-family : Verdana, Arial, Helvetica, sans-serif;
background-color : white;
}
and it validates just fine. I don’t understand the error message from earlier, but it seems to be fine now.
Hmmmm, odd… But at least it works now. I have had odd things like this happen and sort of fix themselves after making other changes. Odd hows that happens…
Well, hope I helped… I will mark this one solved… Have a nice day…
I got some help for my work as well! thanks.