apply bg style to proper class