D
David Dorward
So, I guess that the validator thinks that "#" is a character of the name
of the class... instead it means that what it follows is the name of the
"id"
Looks like it might be a bug then.
So, I guess that the validator thinks that "#" is a character of the name
of the class... instead it means that what it follows is the name of the
"id"
Michael said:[snip]Luigi said:What is wrong with this?
.subsubsection#sverige
So, what is it, a class? (.susubsection) an id? (#sverige)?
Can't make the two into a hybrid.
Certainly can[1].
As for what a 'class error' is, I have no idea. Unless Luigi cares to
mention where (and with what) this error apparently occurred, there's
not much I can add.
[1] See the simple_selector production in Appendix D.1 Grammar of
the CSS 2 Specification.
<http://www.w3.org/TR/REC-CSS2/grammar.html#x1>
[1] See the simple_selector production in Appendix D.1 Grammar of
the CSS 2 Specification.
<http://www.w3.org/TR/REC-CSS2/grammar.html#x1>
David said:Looks like it might be a bug then.
Michael Winter wrote:
[snip]
As for what a 'class error' is, I have no idea. [...]
I saw in another message of his, that he got that from
http://www.htmlhelp.com/tools/csscheck/ which actually does give that
error (erroneously).
Note: I found this link easier to read:
http://www.w3.org/TR/REC-CSS2/selector.html#simple-selector
Michael said:On 26/02/2006 09:11, Els wrote:
[snip]
Note: I found this link easier to read:
http://www.w3.org/TR/REC-CSS2/selector.html#simple-selector
Yes, but I think I ended up paraphrasing the applicable paragraph.
Not intentionally, mind you.
(If I understood appendix B of the CSS1 specs correctly (of which I'm
not sure), only 1 class/id/pseudo-class is allowed per selector in
CSS1)
Michael said:On 26/02/2006 09:21, Els wrote:
[snip]
(If I understood appendix B of the CSS1 specs correctly (of which I'm
not sure), only 1 class/id/pseudo-class is allowed per selector in
CSS1)
I'm not quite sure what you're trying to express, here.
.className or #id
but not
#id.className
As I read it, the grammar permits the latter, but it also places very
tight constraints on the /order/ of simple selector components: element,
id, class, pseudo-class. A simple selector can contain any of these, but
if any are present, they must appear in that order and can only occur
once at most.
The reason why
.subsubsection#sverige a
fails is because the id selector follows the class name.
#sverige.subsubsection a
will be accepted.
Note that the W3C validator doesn't care much for the order, either
because it wasn't meant to be significant (but that fact couldn't be
expressed concisely in the grammar), or due to a bug.
Luigi said:The W3C CSS Validator did not seem to accept
URLs with https and for some reason did not display any results when I tried
to paste the content of the file,
so I used this one instead
http://www.htmlhelp.com/tools/csscheck/
This displayed the error as far as I remember
Afterwards I tried to make many changes in the stylesheet to improve it and
it probably needs be much improved yet
Jonathan said:Luigi said:The W3C CSS Validator did not seem to accept
URLs with https and for some reason did not display any results when I tried
to paste the content of the file,
so I used this one instead
http://www.htmlhelp.com/tools/csscheck/
This displayed the error as far as I remember
Afterwards I tried to make many changes in the stylesheet to improve it and
it probably needs be much improved yet
Okay I think I know what is going on here, when Luigi is trying to
specify a A element that is a child of and ELEMENT that is both
CLASS="subssubsection" AND ID="saverige" fails because
.subsubsection#sverige A
^^^^^^^^^^^^^^^^^^^^^^
this is the wrong way to specify the condition as it is being
interpreted as class "subsubsection#sverige" containing an illegal
character '#' thus giving you the "class error", to what you wish Luigi
I think it should be written:
#sverige[class="subsubsection"] a {...}
Els said:.subsubsection#sverige is actually correct.
Proof:
<http://validator.w3.org/check?verbose=1&uri=http://here.locusmeus.com/temp/idclass.html>
Yep I noticed that too ;-) but yes it also validates. Hmmm I do not knowEls said:Els wrote:
Duh, how about this one:
<http://jigsaw.w3.org/css-validator/...i=http://here.locusmeus.com/temp/idclass.html>
Jonathan said:Yep I noticed that too ;-) but yes it also validates. Hmmm I do not know
why sir Luigi had an error, most likely a duplicate identifier somewhere.
Michael Winter said:On 26/02/2006 09:21, Els wrote:
[snip]
(If I understood appendix B of the CSS1 specs correctly (of which I'm
not sure), only 1 class/id/pseudo-class is allowed per selector in
CSS1)
I'm not quite sure what you're trying to express, here.
.className or #id
but not
#id.className
An id, class, or pseudo-class selector can appear by itself [optionally
combined with an element], but more than one type of attribute selector
cannot be combined.
Or perhaps:
#id.className
but not
.class1.class2
Multiple attribute selector types can be used together, but only one of
each type can be used at once.
As I read it, the grammar permits the latter, but it also places very
tight constraints on the /order/ of simple selector components: element,
id, class, pseudo-class. A simple selector can contain any of these, but
if any are present, they must appear in that order and can only occur
once at most.
The reason why
.subsubsection#sverige a
fails is because the id selector follows the class name.
#sverige.subsubsection a
will be accepted.
Luigi Donatello Asero said:Is
#sverige.subsection a=
<a class="subsection" id="sverige"> ?
"Michael Winter" <[email protected]> skrev i meddelandet
[snip]
The reason why
.subsubsection#sverige a
fails is because the id selector follows the class name.
#sverige.subsubsection a
will be accepted.
So is the latter the correct form although the former is tolerated?
Is
#sverige.subsection a=
<a class="subsection" id="sverige"> ?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.