How do you define a CSS variable within a root element?
- #variable: value;
- $variable: value;
- --variable: value;
- var variable = value;
To define a CSS variable within a root element, you use the syntax --variable: value;. This sets up a custom property that can be later used throughout the stylesheet.
Loading...
Related Quiz
- You have an element with a complicated graphical background, and you want certain parts of the foreground content to reveal or hide portions of this background. Which CSS technique would be most appropriate to achieve this?
- What is the primary benefit of using tools like PostCSS in modern web development workflows?
- What does the currentColor value represent in CSS?
- You have a complex web page layout with nested elements. You want to specifically style an element that is the second child of its parent, regardless of the type of element. Which pseudo-class selector will ensure your style is applied correctly?
- How do you align the markers (like bullets or numbers) of a list inside or outside the content flow?