Attribut-Selektoren

Attribut-Selektor, unspezifisch (alle p mit einem title-Attribut)

p[title] {color: blue; }

<p title="a">Ich habe ein title-Attribut</p>

<p title="b">Ich habe ein title-Attribut</p>

<p title="c">Ich habe ein title-Attribut</p>

Attribut-Selektor, mit spezifischem Attribut-Wert

p[title="Milka-Kuh"] {color: violett; }
p[title="Apfel"] {color: red; }
p[title="Gras"] {color: green; }

Ich habe das Attribut title="violett"

Ich habe das Attribut title="rot"

Ich habe das Attribut title="gruen"

Weiteres Beispiel

p[lang="EN"] {color: red; }
p[lang="DE"] {color: blue; }

English language

Deutsche Sprache