Beispiel:CSS-custom-props-1b.html
Aus SELFHTML-Wiki
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css">
<title>Custom Properties und Vererbung - 2 </title>
<style>
p { color: var(--farbe); }
section.a { --farbe:red; }
section.b { --farbe:blue; }
</style>
</head>
<body>
<h1>Custom Properties - Vererbung unterschiedlicher Werte</h1>
<section class="a">
<p>Hallo Welt</p>
</section>
<section class="b">
<p>Hallo Welt</p>
</section>
<p>Absatz außerhalb einer section</p>
</body>
</html>