Files
uni/slides/223015c/assets/demos/css-specificity.html

31 lines
984 B
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Spezifität</title>
<style>
body { padding: 1.2rem; font-family: system-ui, sans-serif; }
p { color: blue; } /* 0,0,0,1 */
.text { color: green; } /* 0,0,1,0 */
#intro { color: red; } /* 0,1,0,0 */
code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.row { margin-bottom: 10px; }
.label { color: #6b7280; font-size: 0.85em; }
</style>
</head>
<body>
<div class="row">
<p>Nur <code>p</code>: <strong>blau</strong></p>
<span class="label">0,0,0,1</span>
</div>
<div class="row">
<p class="text">Nur <code>.text</code>: <strong>grün</strong> schlägt p</p>
<span class="label">0,0,1,0 &gt; 0,0,0,1</span>
</div>
<div class="row">
<p id="intro" class="text">ID <code>#intro</code>: <strong>rot</strong> schlägt alles</p>
<span class="label">0,1,0,0 &gt; 0,0,1,0</span>
</div>
</body>
</html>