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.
Loading...
Related Quiz
- You are tasked with creating a list where every even item has a gray background. Which CSS selector would help you accomplish this?
- Which of the following properties, when animated, would cause a "repaint" but not "reflow" in most browsers?
- The CSS rule "ul + ul" will target an unordered list that ________.
- You are tasked with creating a vintage look for images on a webpage. Which CSS filter or combination of filters would you likely use?
- OOCSS primarily focuses on separating container and content, and promoting the reuse of ________.