Forum Moderators: not2easy

Message Too Old, No Replies

CSS Validator help

         

Janeypie

5:20 am on Aug 10, 2006 (gmt 0)

10+ Year Member



Hello,

I am new to CSS and am having a frustrating time trying to interpret the css validator error messages. In particular, I keep getting this vague message which means nothing obvious to me:

Line: 54 Context : px
Parse Error - px;

Line: 55
Parse Error - : bold} p

What is a parse error? Are there code words which will help me to figure it out? I am taking a class in css and need to have no errors before I can hand in my work and this has me stumped.

Is there was a book out there, interpreting css validator errors?

Jane

Setek

5:55 am on Aug 10, 2006 (gmt 0)

10+ Year Member



You don't really need a reference about the CSS errors - have you actually taken a look at line 54 and line 55?

And a few of the surrounding lines?

The CSS validator basically checks for well-formed CSS. Any error generated will be a syntax error - as in, something not done right. Examples:

p { background: #f00
border: 1px solid #00f; }

Will return an error because there was no semi-colon at the end of the background property statement. Thus, it believes the one entire line is all for the background property.

Check semi-colons, and curly brackets are all in their rightful spots, and mis-spelled selectors/properties/etc.

Janeypie

12:43 pm on Aug 10, 2006 (gmt 0)

10+ Year Member



> have you actually taken a look at line 54 and line 55?
And a few of the surrounding lines?

Of course I have--and I saw nothing obvious. Here is a snippet of the code:

color: #fffded;
padding: 20px;
border-width:8px;
border-style: groove;
border-color: green;
}
p {
color: #fffded;
background-color: #333333;
font-family: arial, sans-serif;
font-size: 12px;
}

Line 54 corresponds to the closing bracket before the "p" and (obviously) line 55 is on the line right below it. Do you see the problem? I get many of the errors but this one has me scratching my head.

Jane

yellowbeetle

1:08 pm on Aug 10, 2006 (gmt 0)

10+ Year Member



Howdy -
Newbie too.
Does the error "stay put" at that spot in the file? (I mean if you add a line or subtract a line, is it still that spot before the p declaration that marks the hiccup?)

Have you tried more than one validator? Do they all point to the same spot?

What happens if you combine your border declaration?
As in
border: 1px solid orange;
(Are you allowed to within the parameters of the assignment?)

Rough to have to track down errors when for so many "close enough" is good enough! Good luck...