!!blue Posted February 5, 2004 Posted February 5, 2004 I just found out that one of my CSS stylesheets is giving me a parse error? And I'm thinking, "Wha? Huh?" here's what it highlights as incorrect code: >Line: 0 Context : a#home:hover , a#art:hover , a#design:hover , a#wallpaper:hover , a#contact:hover Parse Error - can someone please explain? I'm using a technique from this ALA article: Night of the Image Map. later, !!blue Quote
kaseytraeger Posted February 5, 2004 Posted February 5, 2004 Hi !!blue, Well, I'm no CSS expert, but my programming background causes me to look for certain things, like syntax. One thing I noticed about your CSS line is that you essentially have two colons that are "back-to-back". To my "naked eye" it looks like you're not associating the five items after "Context:" with the "Context:" term. What if you tried putting the five items inside quotes, like this: >Line:0 Context: "a#home:hover, a#art:hover, a#design:hover, a#wallpaper:hover, a#contact:hover" Also, are the "Line:0" term and the "Context:" term supposed to go together? If not, you might try placing a semi-colon between the two of them, like this: >Line:0; Context: "a#home:hover, a#art:hover, a#design:hover, a#wallpaper:hover, a#contact:hover" I don't even know if this will work, but it's an idea, at least. I'll do a bit more research on my end, and if I see anything, I'll certainly post for you! Good luck. Kasey Quote
!!blue Posted February 5, 2004 Author Posted February 5, 2004 bolded items are not in my code, these are written in by W3C's validator. Line: 0 Context: a#home:hover , a#art:hover , a#design:hover , a#wallpaper:hover , a#contact:hover Parse Error It's almost as if it's saying "In Line 0 there is code that is out of Context" or something like that... Actually, I've fixed it; the section of CSS code WAS as follows: >a#home { top: 31px; left: 162px; width: 93px; height: 41px; } a#design { top: 31px; left: 261px; width: 114px; height: 41px } a#art { top: 31px; left: 381px; width: 54px; height: 41px;} a#wallpaper { top: 31px; left: 441px; width: 177px; height: 42px; } a#contact { top: 31px; left: 622px; width: 122px; height: 42px;} a#home:hover { background-image: url(../images/index2.gif); } a#art:hover { background-image: url(../images/art2.gif); } a#design:hover { background-image: url(../images/design2.gif); } a#wallpaper:hover { background-image: url(../images/wallpaper2.gif); } a#contact:hover { background-image: url(../images/contact2.gif); } /* this section didn't validate + + + + + + */ a#home:hover, a#art:hover, a#design:hover, a#wallpaper:hover, a#contact:hover, { border: none; } But now I just combined the two hover's and just added the "border: none;" to each a:hover line like so: >a#home:hover { background-image: url(../images/index2.gif); border: none; } a#art:hover { background-image: url(../images/art2.gif); border: none; } a#design:hover { background-image: url(../images/design2.gif); border: none; } a#wallpaper:hover { background-image: url(../images/wallpaper2.gif); border: none; } a#contact:hover { background-image: url(../images/contact2.gif); border: none;} it got kinda crazy there for a minute !!blue Quote
kaseytraeger Posted February 6, 2004 Posted February 6, 2004 Good morning, !!blue, I'm happy to hear that you were able to figure out the troubles with your CSS code not validating properly. Thanks for explaining that the Line 0: and Content: lines were part of the CSS validator. I was beginning to think I was going crazy ... I was looking through all my books and online resources for those two bits of "code" and just couldn't find them anywhere. By the way, I should probably be doing a bit of validating of my own CSS (which I may end up posting here because I can't get the positioning right on some of items). Would you mind posting the URL where I can get this validator? Thanks, and congrats on fixing your problem! Kasey Quote
TCH-Bruce Posted February 6, 2004 Posted February 6, 2004 Kasey, Here is one validator: http://jigsaw.w3.org/css-validator/validator-uri.html Quote
kaseytraeger Posted February 6, 2004 Posted February 6, 2004 I thank you kindly, TCH-Bruce, for the link. I just checked one of my CSS files using the service and discovered a few grammatical errors, so I can see that this is going to be a very useful tool for me! Again, thank you, thank you! Kasey Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.