<!DOCTYPE html> <style> div { color: green; } .red > span { color: red; } </style> <div><span></span></div> <div><span>This text should be green.</span></div>