Skip to content

text-white cannot be overridden by any color #11188

Answered by adamwathan
akkidongre asked this question in Help
Discussion options

You must be logged in to vote

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>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@akkidongre
Comment options

Answer selected by akkidongre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants