CSS Attribute Selector madness?

Today I stumbled upon a CSS attribute selector which made me think.

div.fooClass[class]
{
height: 29px;
}

The interesting thing here is the [class] part of the CSS. If I understand correctly, this means, that elements should be selected which have the class attribute. I understand why someone might be interested to style all images with alt-tags differently: img[alt]. But is there any legitimate use of [class]? Cause this only says: select elements which have a class assigned… It does not even check WHICH class, it selects just all classes. And it gets weirder when it is combined with a specific class like fooClass in this example. Has anybody an idea what this means?

Advertisements

Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: