What is the correct syntax to use a custom property in your CSS?

  • #property-name
  • &property-name
  • *property-name
  • --property-name
To use a custom property (also known as a CSS variable), you should use the syntax --property-name. Custom properties allow you to define reusable values in your CSS and use them throughout your stylesheet. They are preceded by two hyphens and are referenced with the var() function, like var(--property-name).
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *