...

View Full Version : css want validate in validator. What am I doing wrong?



befuddled
01-03-2006, 12:17 AM
Hello Coders,
First let me say I wish everyone a profitable and happy new year.
Now that is out of the way here is my problem, the code and what the Validator spits back at me. I've been working on this style sheet for a while and I'm clueless.
Here's the code:
body { background-color:#fff ;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#000;
}

a:hover { font-family:Verdana, Arial, Helvetica, sans-serif;
color:#000;
background-color: white}

h1 { font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:36px}

h2 { font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:30px}

h3 { font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:24px}

#leftcontent { position: absolute;
left:10px;
top:192px;
width:100px;
background:#ccc;
border:0px solid ;
}

#centercontent { top:192px;
background:#fff;
margin-left:99px;
margin-right:119px;
border:0px solid ;
voice-family: "
\"
}

\"
"
;
voice-family: inherit;
margin-left:101px;
margin-right:121px;
}

html>
body #centercontent { margin-left:101px;
margin-right:121px;
}

#rightcontent { position: absolute;
right:10px;
top:192px;
width:120px;
background:#ccc;
border:0px solid ;
}

#banner { background:#fff;
height:165px;
border-top:1px solid #000;
border-right:1 solid #000;
border-left:1 solid #000;
voice-family: "
\"
}

\"
"
;
voice-family: inherit;
height:164px;
}

html>
body #banner { height:164px;
}

p,h1,h2,h3 { margin:0px 10px 10px 10px;
}
Here's the Solution that I'm clueless about, ( I've tried for over 5 hours. Yah, I'm a noob.)
Line: 34 Context : #centercontent
Invalid number : voice-family Parse Error - " \"

Line: 39 Context : "
Parse Error - " ;

Line: 46
Parse Error - : inherit; margin-left:101px; margin-right:121px; } html> body #centercontent

Line: 61 Context : #banner
Invalid number : border-right 1 is not a border-color value : 1 solid #000

Line: 62 Context : #banner
Invalid number : border-left 1 is not a border-color value : 1 solid #000

Line: 64 Context : #banner
Invalid number : voice-family Parse Error - " \"

Line: 69 Context : "
Parse Error - " ;

Line: 75
Parse Error - : inherit; height:164px; } html> body #banner

I hope that someone can help me out. I really want to be close to compliant.
I've worked the original errors down to this and no matter what I do I can't solve the riddle.
Thanks,
Befuddled alias Mike

goldingh99
01-03-2006, 12:44 AM
try this (i've modified what you wrote)


body { background-color:#fff ;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#000;
}

a:hover { font-family:Verdana, Arial, Helvetica, sans-serif;
color:#000;
background-color: white}

h1 { font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:36px}

h2 { font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:30px}

h3 { font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:24px}

#leftcontent { position: absolute;
left:10px;
top:192px;
width:100px;
background:#ccc;
border:0px solid ;
}

#centercontent { top:192px;
background:#fff;
margin-left:99px;
margin-right:119px;
border:0px solid ;
}

#centercontent { margin-left:101px;
margin-right:121px;
}

#rightcontent { position: absolute;
right:10px;
top:192px;
width:120px;
background:#ccc;
border:0px solid ;
}

#banner { background:#fff;
height:165px;
border-top:1px solid #000;
border-right:1 solid #000;
border-left:1 solid #000;
}

#banner { height:164px;
}

p,h1,h2,h3 { margin:0px 10px 10px 10px;
}

i got rid of the voice-family as i dont know what it does and i took out some extra stuff, but now it should work without errors, if you wanted voice-family i have know idead how to incooperate it in

i hope this helps

mark87
01-03-2006, 01:14 AM
Voice-family is for aural. But certainly things like -


voice-family: "
\"
}

\"
"
;
voice-family: inherit;
height:164px;
}

Are invalid.

befuddled
01-03-2006, 01:15 AM
Hello goldingh99,
Thanks for such a quick reply.

You really helped me and did better than what I could've done with my limited knowledge.

If you would be so kind could you look at these last two things that stop the CSS from validating.

Here are the last two from the Validator and they are similiar to the problem
that I had with border-top.

Line: 50 Context : #banner
Invalid number : border-right 1 is not a border-color value : 1 solid #000

Line: 51 Context : #banner
Invalid number : border-left 1 is not a border-color value : 1 solid #000.

I'm a Graphics designer and not a coder. I'm trying to learn, but for a Grandpa it's not easy. LOL.

Thanks Again,
Befuddled alias mike

P.S. If you should need any Graphics done I can return the favor. I just don't like getting something for nothing.

_Aerospace_Eng_
01-03-2006, 09:08 AM
You need to use units when you are using CSS
so border-left:1px solid #000; should validate.

ronaldb66
01-03-2006, 12:51 PM
By the way: if you do want to use the Tantek Celik hack:
voice-family: "\"}\"";
voice-family:inherit;
you should realise that this will not validate. With the upcoming IE7, Microsoft officials advice to use IE conditional statements rather than hacks anyway--which probably won't validate either.

Bill Posters
01-03-2006, 12:59 PM
With the upcoming IE7, Microsoft officials advice to use IE conditional statements rather than hacks anyway--which probably won't validate either.
Why wouldn't they? After all, to everything other than IE/Win, they are just plain SGML comments.
I've been using CCs for a while to deliver an IE/Win-specific stylesheet and have no problems validating my pages upto XHTML 1.1* served as application/xhtml+xml.
(* though I typically use XHTML 1.0 Strict.)

ronaldb66
01-03-2006, 01:23 PM
Bill,

Thanks for the update: to be honest, I haven't tried them out yet. That they do validate makes using conditional statements an even better alternative--be it only for IE.

befuddled
01-03-2006, 08:25 PM
:thumbsup: Hi Aerospace_Eng_ ,
Thanks for explaining the problem. It worked great and now I know how to handle future problems of this nature.
Does the proceeding sentence mean that I have to attach this to a web page as I intend to do?
(To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.) I can live with the warnings. I'm going to make the background color:
#D8D6D7
Warnings
URI : file://localhost/TextArea
Line : 26 (Level : 1) You have no color with your background-color : #leftcontent
Line : 31 (Level : 1) You have no color with your background-color : #centercontent
Line : 45 (Level : 1) You have no color with your background-color : #rightcontent
Line : 49 (Level : 1) You have no color with your background-color : #banner

I just want to say that I'm a member of a highly respected business forum and these old stogies (myself included) can learn alot by modeling their forum after this one. The wholehearted and unselfish help that is displayed here is phenomenal - plus the price is right.
Thanks again for all your help you've all been great.
Sincerely,
Befuddled alias Mike

_Aerospace_Eng_
01-03-2006, 09:10 PM
Its saying your CSS is valid but it gives you those warnings for accessibility reasons eg same font color on same font background. You should always declare a background color because not everyone's default background is white.

befuddled
01-04-2006, 03:59 AM
Hi Aerospace_Eng_ ,
Thanks for all your help.
I put you in for nomination.
Good luck and may all your endeavors in life be fruitful.
Sincerely,
( No longer Befuddled) alias mike



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum