Skip to content

Commit f9d5cf3

Browse files
committed
Update css-practice.md
1 parent 2ca0b10 commit f9d5cf3

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

css-practice.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,9 @@ Pick ONE OR MORE options
11141114

11151115
Which of the following renders the text red?
11161116

1117+
```html
11171118
<p id="tagld">Please color me red</p>
1119+
```
11181120

11191121
Pick ONE OR MORE options
11201122

@@ -1128,6 +1130,30 @@ Pick ONE OR MORE options
11281130
4. p { color: red !important; } #tagId { color: blue; }
11291131
```
11301132

1133+
<details><summary><b>Answer</b></summary>
1134+
1135+
```css
1136+
:root {
1137+
--text-color: red;
1138+
}
1139+
p {
1140+
color: var(--text-color);
1141+
}
1142+
```
1143+
1144+
```css
1145+
p {
1146+
color: red !important;
1147+
}
1148+
#tagId {
1149+
color: blue;
1150+
}
1151+
```
1152+
1153+
**&#9885; [Try this example on CodeSandbox](https://codesandbox.io/s/css-text-coloring-4qyf4d?file=/src/styles.css)**
1154+
1155+
</details>
1156+
11311157
<div align="right">
11321158
<b><a href="#">↥ back to top</a></b>
11331159
</div>

0 commit comments

Comments
 (0)