In the lesson, Learn Basic CSS: Inherit CSS Variables, the text “element.” is using a monospaced font. It also seems like a word is missing before it.
Here’s a screenshot:
In the lesson, Learn Basic CSS: Inherit CSS Variables, the text “element.” is using a monospaced font. It also seems like a word is missing before it.
Here’s a screenshot:
I think it’s just missing the word root
.
To make use of inheritance, CSS variables are often defined in the root element.
Here’s an example of defining variables in the root element
:root {
--blue: #1e90ff;
--white: #ffffff;
}
Then using those variables:
h2 { border-bottom: 2px solid var(--blue); }
.container {
color: var(--blue);
background-color: var(--white);
padding: 15px;
}
there should be “To make use of inheritance, CSS variables are often defined in the :root
element:”
there is an issue with the parser, it doesn’t like “:root”, it is being worked on