text-white cannot be overridden by any color #11188
Answered
by
adamwathan
akkidongre
asked this question in
Help
-
Beta Was this translation helpful? Give feedback.
Answered by
adamwathan
May 9, 2023
Replies: 1 comment 1 reply
-
Hey! You should only add one text color class, that's what the squiggly yellow lines are telling you. The browser doesn't override CSS classes left to right like that, CSS precedence is based on the order of the classes in the CSS file, not in your HTML. Both of these elements will have black text: <style>
.white { color: white }
.black { color: black }
</style>
<span color="white black">Hello</span>
<span color="black white">Hello</span> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
akkidongre
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! You should only add one text color class, that's what the squiggly yellow lines are telling you.
The browser doesn't override CSS classes left to right like that, CSS precedence is based on the order of the classes in the CSS file, not in your HTML.
Both of these elements will have black text: