0

I have the following HTML:

<div id="footer">
  <div class="wrapper clear">
    <!-- stuff -->
  </div>
<div>

What do I put in the css file to format the div that has a class of wrapper and clear, but only when within the footer?

This is for use with wordpress.com, so I can't alter the HTML.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Curyous
  • 8,716
  • 15
  • 58
  • 83

2 Answers2

5

Use this selector:

#footer .wrapper.clear

Note that IE6 doesn't handle multiple class selectors correctly, it treats the above as this (see here for a comparison):

#footer .clear

But in most cases this should not matter.

Community
  • 1
  • 1
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
0

I think what you are looking for is this:

#footer div[class="wrapper clear"] { /* your awesome CSS code */}
AeroCross
  • 3,969
  • 3
  • 23
  • 30
  • 2
    **You don't select classes using the attribute selector!** – BoltClock Feb 12 '11 at 22:20
  • 1
    Although true, it works too (I got miscarried away by the separated list of values selector (div[class~='wrapper'])). Never used that in my code, though. – AeroCross Feb 12 '11 at 22:25