For a CSS Variable to be inherited by all descendants, it should be defined in the :________ pseudo-class.

  • :descendant
  • :global
  • :inherit
  • :root
The correct answer is ":root." When you define a CSS variable in the :root pseudo-class, it becomes a global variable accessible throughout the document, and it is inherited by all descendants. This is commonly used to set global values for colors, fonts, or other properties that need to be consistent across the entire document.
Add your answer
Loading...

Leave a comment

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