Anriëtte Myburgh
Anriëtte Myburgh

Reputation: 13517

Internet Explorer 6 (urgh) and CSS - applying multiple classes to a style

I would like to know how well does Internet Explorer 6 interpret the following:

p img.blue, p img.red {
  border:(purple) 1px solid; /* (Please ignore any style errors) */
}

What I am interested in the application of multiple classes to the same style. I know that IE6 does not interpret the following correctly:

p img.blue.red {
  border:(purple) 1px solid; /* (Please ignore any style errors) */
}

Does anyone know a bit about this? Regards and TIA.

// edit:

Please note, I am enquiring about the first block of code.

Upvotes: 0

Views: 671

Answers (2)

Iain Galloway
Iain Galloway

Reputation: 19190

IE interprets

p img.blue, p img.red { /* */ }

correctly, by applying the contained styles to img elements with class="blue" which are children of p elements, or img elements with class="red" which are children of p elements.

IE doesn't understand p img.blue.red, it would only apply the style to p img.red

Upvotes: 4

Teddy Zetterlund
Teddy Zetterlund

Reputation: 131

I'll just quote Ryan Brill:

IE6 doesn't understand the chain of classes within a CSS selector, but rather only reads the last class

Upvotes: 1

Related Questions