The following should do the trick: div[class^='myclass'], div[class*=' myclass']{ color: #F00; } Edit: Added wildcard (*) as suggested by David