most examples i see for css code include a name even when it is not needed, for example they would be something like this:
a.class { blah . . . .
in my css (which works fine in both IE & NS) i have:
.class { blah . . . .
so what is the "a" for (and always an "a") and what does it mean when it has no need to be there?
I understand when name is needed, for example:
P.class { blah . . .
but when it is not needed many examples always put an "a" there.When it's not there, then it can be applied to any tag as necessary. When you specify
tagName.className
and try to apply the class name to a different tag, it's not supposed to work.
all.className
and
.className
are apparently equivalent.
a.className
should only work for anchors.thanks gil - that makes perfect sense. i have just seen so many examples that have always had the "a" i thought there may be more to it. so i was not associating the a with anchors. should have - duh . . . sometimes you just can't see the trees.Originally posted by gil davis
all.className
and
.className
are apparently equivalent.
No they are not.
*.class and .class is though
<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/selector.html#q1">http://www.w3.org/TR/REC-CSS2/selector.html#q1</a><!-- m -->
a.class { blah . . . .
in my css (which works fine in both IE & NS) i have:
.class { blah . . . .
so what is the "a" for (and always an "a") and what does it mean when it has no need to be there?
I understand when name is needed, for example:
P.class { blah . . .
but when it is not needed many examples always put an "a" there.When it's not there, then it can be applied to any tag as necessary. When you specify
tagName.className
and try to apply the class name to a different tag, it's not supposed to work.
all.className
and
.className
are apparently equivalent.
a.className
should only work for anchors.thanks gil - that makes perfect sense. i have just seen so many examples that have always had the "a" i thought there may be more to it. so i was not associating the a with anchors. should have - duh . . . sometimes you just can't see the trees.Originally posted by gil davis
all.className
and
.className
are apparently equivalent.
No they are not.
*.class and .class is though
<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/selector.html#q1">http://www.w3.org/TR/REC-CSS2/selector.html#q1</a><!-- m -->