Beispiel:CSS-custom-props-2.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!doctype html>
<html lang="de">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css">
  <title>Custom Properties - 2</title>
  <style>
:root { --akzentfarbe: 195 46 4 }
h1 { color: rgb(var(--akzentfarbe)) }
h2 { color: rgb(var(--akzentfarbe) / 0.5) }

</style>
</head>
 
<body>
  <h1><em>Custom Properties</em> (CSS-Variablen)</h1>
  <h2><em>(Custom Properties)</em></h2>
  <p>
	<pre><code>
:root { --akzentfarbe: 195  46  4 }
h1 { color: rgb(var(--akzentfarbe)) }
h2 { color: rgb(var(--akzentfarbe) / 0.5) }
    </code></pre>
  </p>

</body>
</html>