2 replies [Last post]
PARoss
PARoss's picture
Offline
Enthusiast
Last seen: 8 years 13 weeks ago
Timezone: GMT-5
Joined: 2005-10-29
Posts: 147
Points: 14

What's the difference between these? Are the the same? Is one better than the other?

a.sample {
border:0 none;
}

.sample a {
border:0 none;
}

Phil

briski
briski's picture
Offline
Elder
London
Last seen: 8 years 47 weeks ago
London
Timezone: GMT+1
Joined: 2004-02-16
Posts: 1066
Points: 0

The first applies to a link

The first applies to a link which has a class of sample. The Second applies to a link that in the decendant of something which has a class of sample. Neither is better than the other, they are just different.

Try looking here for more details of selectors

http://www.csscreator.com/node/4532

DanA
DanA's picture
Offline
Elder
Last seen: 11 years 5 days ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

They are completely

They are completely different

a.sample will be for <a class="sample"

.sample a will be for <p(or any other tag) class="sample"><a

Too late, how can we remove a useless comment ?