Old 18-04-2006, 15:02   #1 (permalink)
bob_visualefx
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:
<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>

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
  Reply With Quote
Old 18-04-2006, 15:12   #2 (permalink)
funkyprem
For all your goober needs
 
funkyprem's Avatar
 
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>
  Reply With Quote
Old 18-04-2006, 15:23   #3 (permalink)
bob_visualefx
laughing fuzzball
 
Join Date: Mar 2006
Posts: 59
Thanks! I just tested removing things, changing others, and even starting over straight from Dreamweaver it doesn't validate. Hmmm....
-Bob
  Reply With Quote
Old 18-04-2006, 15:27   #4 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,126
Are you including external css or is that on your page? Where is your page? Can we see?
  Reply With Quote
Old 18-04-2006, 15:35   #5 (permalink)
bob_visualefx
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
  Reply With Quote
Old 18-04-2006, 15:52   #6 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,333
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).
  Reply With Quote
Old 18-04-2006, 16:18   #7 (permalink)
bob_visualefx
laughing fuzzball
 
Join Date: Mar 2006
Posts: 59
Cool! Thanks, man.

I have to say, you guys have all been really helpful with me since I joined. Thanks to all!
-Bob
  Reply With Quote
Old 02-06-2008, 10:23   #8 (permalink)
mumbojumbo
Registered User
 
mumbojumbo's Avatar
 
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.
  Reply With Quote
Old 02-06-2008, 11:03   #9 (permalink)
MikeMackay
Shun the non-believer
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Essex, UK
Posts: 1,933
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by mumbojumbo
#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;
}
You need to remove that last ',' on the '#nero a#neroLink' line, then you'll be set.

Code:
#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; }

...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.
__________________
  Reply With Quote
Old 02-06-2008, 13:06   #10 (permalink)
mumbojumbo
Registered User
 
mumbojumbo's Avatar
 
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.
  Reply With Quote
Old 02-06-2008, 13:13   #11 (permalink)
MikeMackay
Shun the non-believer
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Essex, UK
Posts: 1,933
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by mumbojumbo
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.
I didn't mean to sound like I was having a go, just a friendly pointer for the future.
__________________
  Reply With Quote
Old 20-02-2009, 20:30   #12 (permalink)
ruddycavalcanti
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
  Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive
vBulletin © 2000-2009 Jelsoft Enterprises Limited.
Search Engine Optimization by vBSEO 3.0.0 RC8