Home
CSS
CSS @property
Tryit: Simple use 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: true; initial-value: lightgray; } @property --my-txt-color { syntax: "<color>"; inherits: true; initial-value: darkblue; } div { width: 300px; height: 150px; padding: 15px; background-color: var(--my-bg-color); color: var(--my-txt-color); } </style> </head> <body> <h1>The @property Rule</h1> <div>This is a div with some text.</div> </body> </html>