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
  • 700,868
  • 160
  • 1,392
  • 1,356
shealtiel
  • 8,020
  • 18
  • 50
  • 82

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
  • 21,110
  • 9
  • 55
  • 65
  • 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,289
  • 11
  • 53
  • 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,760
  • 1
  • 24
  • 24