3

Here is a code snippet:

div.note.note_expanded

What does it mean? I understand div.className, but what is the second dot?

BoltClock
  • 665,005
  • 155
  • 1,345
  • 1,328
shealtiel
  • 7,480
  • 17
  • 48
  • 81

3 Answers3

8

A div that has the class note and note_expanded at the same time

Something like <div class='note note_expanded'> would match that.

Robert
  • 20,680
  • 9
  • 53
  • 64
  • Obligatory link to IE6 nonsense explained: http://stackoverflow.com/questions/3772290/css-selector-that-applies-to-elements-with-two-classes/3772305#3772305 – BoltClock Jun 14 '11 at 22:29
  • 6
    @BoltClock: I think we as developers have a responsibility to form a league of extraordinary developers mainly to go around an punch anyone who still uses that browser. – Robert Jun 14 '11 at 22:31
2

This would target a div that has both a class of .note and a class of .note_expanded.

<div class="note note_expanded">I'm special!</div>

Dave Kiss
  • 10,009
  • 11
  • 51
  • 75
1
<style>
div.note.note_expanded {
  color:blue;
}
div.note {
  color:red;
}
div.note_expanded {
  color:black;
}
</style>
<div class='note note_expanded'> 
This is blue but I would think there must be an easier way.
</div>
Wayne
  • 4,638
  • 1
  • 22
  • 24