/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisDec 09.2002 — When it's not there, then it can be applied to any tag as necessary. When you specify

[font=courier]tagName.className[/font]

and try to apply the class name to a different tag, it's not supposed to work.

[font=courier]all.className[/font]

and

[font=courier].className[/font]

are apparently equivalent.

[font=courier]a.className[/font]

should only work for anchors.
Copy linkTweet thisAlerts:
@Beach_BumauthorDec 09.2002 — 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.
Copy linkTweet thisAlerts:
@StefanDec 09.2002 — [i]Originally posted by gil davis [/i]

[B]

[font=courier]all.className[/font]



and



[font=courier].className[/font]



are apparently equivalent.

[/QUOTE]




No they are not.



*.class and .class is though



http://www.w3.org/TR/REC-CSS2/selector.html#q1
×

Success!

Help @Beach_Bum spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...