How would you define a custom property (or variable) in CSS?

  • #variable: value;
  • $variable: value;
  • --variable: value;
  • @variable: value;
To define a custom property (or variable) in CSS, you use the format --variable: value;. Custom properties start with a double hyphen (--) and are followed by the property name, a colon, and the value. These custom properties can then be used to store and reuse values throughout your stylesheet.
Add your answer
Loading...

Leave a comment

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