<!DOCTYPE html> <style> [foo]:before { content: "This text should appear"; } </style> <div></div> <div foo></div>