Css parse error
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
- This topic is empty.
I am just messing around with trying to create a forum and I have multiple thing’s working including my shop etc. but when I get W3C Validator to try and validate my CSS it return’s a parse error on line 8, This is the tiny amount of CSS that it is refering to:-
is the anchor you are applying the rules positioned in any way?
absolute or relative position?
What are you trying to do with that code?
My **guess** is that you are trying to position the link/button but haven’t set a positioning attribute yet
If you’re positioning an element like that ( it’ll need the “position:” too) then you won’t need to specify all of that… top and left should do it. Otherwise left is conflicting with right…top is conflicting with bottom.
Unless of course these are margins and you’ve left margin off?
A link to the full page code:-
The sellfy button itself was provided by Sellfy UAB so I don’t know if there is an issue with that, The code is from this page:-
(I haven’t positioned the button in the correct place on purpose btw)
P.S thanks for the super quick replies ^_^
if you are vaidating the page you sent us
the parser shows an extra semicolon from here
just remove it after the closing bracket
>(I haven’t positioned the button in the correct place on purpose btw)
Then I think we’ve identified the issue.
so that would be to do with the board’s css then not the sellfy button ^_^ now to hunt through 2000 line’s of CSS ^_^
the button is an external image, linked to a .js file over which I have no control, The only thing I can control is it’s position (and that took forever to work out), The parser would not have any issue with where the button is located.
>The parser would not have any issue with where the button is located.
You are telling it to position it…but not in context to what.
Also, as @iknowdavehouse mentioned, you have conflicting value.
I still get a parse error using that code, I will paste the W3C report and also the new updated code into 2 separate document’s and provide link’s in a few moments.
A link to all the file’s connected to that page:-
Includes W3C Val /> A nre copy with updated HTML and CSS
Can someone explain this to me step by step because I don’t really know what to do with CSS 🙂 I know a few term’s, lingo etc. but only enough to create a very simple style sheet 🙂
Why not just give us a link to the live site?
- The forum ‘CSS’ is closed to new topics and replies.
How do you stay up to date in this fast-moving industry?
A good start is to sign up for our weekly hand-written newsletter. We bring you the best articles and ideas from around the web, and what we think about them.
CSS-Tricks * is created, written by, and maintained by Chris Coyier and a team of swell people. The tech stack for this site is fairly boring. That’s a good thing! I’ve used WordPress since day one all the way up to v17, a decision I’m very happy with. I also leverage Jetpack for extra functionality and Local for local development.
* May or may not contain any actual «CSS» or «Tricks».
CSS-Tricks is hosted by Flywheel, the best WordPress hosting in the business, with a local development tool to match.
ShopTalk is a podcast all about front-end web design and development.
Css parse error
I recently bought Professional CSS from WROX (and excellent it is). I am trying to implement a technique from Chapter 3 and am getting a strange CSS Parse error.
generates the following parse error in W3C CSS validator and the rule settings do not take effect in my HTML, although other rules from same stylesheet do.
* Line: 19 Context : CSS
Parse Error — div#body
Can anybody see the problem?
As you can see if you validate that single rule, there is nothing wrong with it. Possibly it isn’t a good idea to use an element name as the name of an id, but that’s beside the point.
It’s a local file on my Mac but here’s the stylesheet
PS I agree with you re using an element name but I was trying to understand teh basic technique so I just mimicked the book. Incidentally, I have tried changing the class name but to no effect.
/* this CSS comes from the beginning of the Blogger example in Chapter 3 of Professional CSS and allows main and sidebar divs to swap over left and right*/
/* this following div constrains everything to a certain width and provides room for the two contaimed
to sit side by side. Auto property for margins centers the content*/
/*The CSS Validator at W3C produces the following error message: To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.
URI : file://localhost/FlexiSidebar.css
* Line: 13 Context : CSS
/* default setting for sidebar — will not display and will be removed from flow unless a class is specified in the body tag All the CSS from here to end of file works allowing me to switch positions between Main and Sidebar left/right/no sidebar. However the rule above is not styling Body. Why not?*/
/* and here is the styling if such a class is specified, constraining #main to a certain width to make room alongside for the sidebar*/
body.sm div#main <
width: 490px; /* redesign this to ems*/
/* similarly setting the styling for #sidebar in such a circumstance*/
body.sm div#sidebar <
display: block; /* and this counteracts the display: none default style for the sidebar above*/
width: 200px; /* redesign this to ems */
/* having set up the styling the next two rules position sidebar left or right */