| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
laughing fuzzball
Join Date: Mar 2006
Posts: 59
|
CSS Parse Error?
HI All, I'm trying to validate my CSS, but everytime I do it W3C tells me "Parse Error - Unrecognized". Is there anyone that can clue me in to what that means? Here is my code: Code:
Here is what W3C says: * Line: 6 Parse error - Unrecognized : <style type="text/css"> <!-- body { background-color: #336699; margin: 0px; } I'm trying to learn to use CSS for all my layouts and avoid tables completely, so I'd like to be able to fully understand CSS before I start using it regularly. Thanks for any help! -Bob |
|
|
|
|
|
#2 (permalink) |
|
For all your goober needs
Join Date: Dec 2004
Location: Coventry, UK
Posts: 1,848
|
you only need to comment out javascript not CSS. that might help (i think) also, your mix of px and % measurements might cause you problems but without seeing the code in context, again I could be wrong. Try... <style type="text/css"> body { background-color: #336699; margin: 0px; } #content { text-align: center; margin-top: -78px; margin-left: -200px; position: absolute; top: 50%; left: 50%; width: 401px; height: 157px; } </style> |
|
|
|
#5 (permalink) |
|
laughing fuzzball
Join Date: Mar 2006
Posts: 59
|
Hmm, I didn't think about it that way. Thanks, stickmus!! To answer your question, it's included in the page as of right now, but will probably eventually be in a separate file. When I put it in a separate file, it validates fine, but included in the page it doesn't. Oh well. -Bob |
|
|
|
#6 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,334
|
99% of the time it's best to put your CSS in a separate file. That way you don't have to paste it in every HTML file, it doesn't have to download each time, and your presentation (CSS) is efficiently separated from your content (HTML). |
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Jun 2008
Posts: 2
|
css parse error
I am taking evening lessons, and have to make a website based on xhtml/css/php. When I validate my css code I get a parse error for a part of the navigation bar: the links get a different background image depending on their status (active hover visited,...) the active page gets a paperclip next to its link so that people see where they are. The code works fine in IE7 (everything is functional - the various images are visible each time), but the paperclip does not show in Firefox. I do not understand why. I have tried changing that bit of code, but then it does not function at all. It is the only error I get. Here is the code - I hope you can see it, it is the first time I am posting here. #header_right_bottom ul { width: 100%; height: 50px; list-style: none; } #header_right_bottom li { padding: 15px 2px 5px 0px; margin-right: 1px; display: inline; float: left; } #header_right_bottom a { padding: 5px 35px 5px 3px; text-transform: uppercase; text-decoration: none; text-align: left; font: 10pt bold; color: #000; background: url(../images/link%20copy.jpg) no-repeat right; } #header_right_bottom a:hover{ color: #C30; background: url(../images/go.png) no-repeat right; } #header_right_bottom a:visited { color: #f90; } this is the problematic part #index a#homeLink, #about a#aboutLink, #contact a#contactLink, #mixture a#mixtureLink, #arno a#arnoLink, #nero a#neroLink, { background: url(../images/bg_here.png) no-repeat right; } Would anybody have a solution? Thanks in advance. |
|
|
|
#9 (permalink) | |
|
Shun the non-believer
|
Quote:
Code:
...and just for the future, you might upset people (especially the OP) if you hijack their thread with your own coding issues. It's usually best to create your own thread. |
|
|
|
|
#10 (permalink) |
|
Registered User
Join Date: Jun 2008
Posts: 2
|
thx
Thank you very much for your help. It works. I did not mean to hijack a thread, I noticed someone with another css parse error and thought it would be ok to continue with a new question under the same thread. So please accept my apologies. I am only starting to build websites and have to proceed step by step with my code! Thanks again. |
|
|
|
#11 (permalink) | |
|
Shun the non-believer
|
Quote:
|
|
|
|
|
#12 (permalink) |
|
Registered User
Join Date: Feb 2009
Posts: 1
|
Parse Error
Hi Everyone. I`m trying to validate my css code, but I`m having problems with PARSE ERROR ! Its appearing Error in line 16, but this line is empty! my website is criar-sites.net i would be gratefull with some help ! att, Ruddy Cavalcanti |
|
![]() |
|