Edit in JSFiddle

<div id="bar" class="foo">
  Nam pretium turpis et arcu 
</div>
#bar{ /* Specificity: 0,1,0,0 */
  color: red;
}
.foo{ /* Specificity: 0,0,1,0 */
  color: green;  
}