Home
CSS
CSS @property
Tryit: Inherits value of @property
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> @property --my-bg-color { syntax: "<color>"; inherits: false; initial-value: lightgray; } div { width: 300px; height: 150px; padding: 15px; background-color: var(--my-bg-color); } .fresh { --my-bg-color: #ff6347; } </style> </head> <body> <h1>The @property Rule</h1> <div>DIV1</div> <div class="fresh">DIV2 <div class="inner">Inner DIV</div> </div> </body> </html>