<!DOCTYPE html><style type="text/css">div[foo~=""] { background-color: red; }</style> <div foo="">[~=] attribute selector looking for empty string in empty attribute (the text should not have red background)</div>