How to set color contrast?

Tell us what’s happening:
How to set the color-constrast?
Saw on internet but couldn’t find any thing other than comparison.

Your code so far





The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Step 45

Link to the challenge:

There is an experimental color-contrast function in the works but no browsers support it so you can’t use it here. Do you remember what CSS property to use to set the color of text? You already did this for the h1 element, so you can look there to remind you. That’s all you need to do for the anchor elements. Just choose a color that is light enough to have at least a 7:1 contrast with the black background. A good guess would be to choose a color that is the opposite of black.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.