2 replies [Last post]
m2land
Offline
newbie
Last seen: 12 years 1 week ago
Joined: 2007-11-12
Posts: 6
Points: 0

Anybody know what's the meaning of ".featureArea.j[class]" in below CSS code? that kind of style is so strange for me. :?

.featureArea{ position:relative; top:0; height:335px; } .featureArea.j[class] { background:url('/shared/core/1/images/FeatArea_BG_3panel.png'); background-repeat:no-repeat; }

syrupcore
Offline
Enthusiast
Last seen: 10 years 44 weeks ago
Timezone: GMT-8
Joined: 2004-03-10
Posts: 108
Points: 0

It's an attribute selector

It's saying "if there is a class on elements classed both .featureArea and .j, {do something}". obviously, since it's already a class based selector, the element has a class. I have a feeling this is being used to exploit the fact that IE6 doesn't understand attribute selectors and is thereby hiding the background png from IE6 (which doesn't support png transparency either).

Attribute selectors are fantastic. I can't wait until we can all use them regularly - particularly for forms.

http://www.w3.org/TR/css3-selectors/#selectors

m2land
Offline
newbie
Last seen: 12 years 1 week ago
Joined: 2007-11-12
Posts: 6
Points: 0

Got it,many thanks for

Got it,many thanks for your detailed explaination!!