Learn Accessibility by Building a Quiz - Step 46

Tell us what’s happening:

hi guys, I have been trying to select this anchor elements nested with in the list items. I have given the color property and set the value of it to 7:1 as instructed. but, it is not working. it still tells me to give the color property for the anchor elements. I have tried it in various manners, but it is not working at all. please tell me what can I do to fix my code. thanks. your responses would be appriciated.

Your code so far

<!-- file: index.html -->

/* file: styles.css */
/* User Editable Region */



/* User Editable Region */

Your browser information:

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

Challenge Information:

Learn Accessibility by Building a Quiz - Step 46

Hi there!

You didn’t tried anything. Where’s your code?
Post your code here in your topic.

For the challenge step, you didn’t need to add the ratio 7:1. you need to change the a element text color within your li element to apposite of it’s background color.

oh yeah. sorry pardon, I have araised what i was trying since it was not working. here is the code I was trying.

li > a {
  color: 7:1;
}

you also said that the previous color has to be changed to the opposit or something. how am I suppose to know what is previous color if I am a visually impaired. please help me in this regard. thanks.

Make the color value to an opposite color a element’s background color. For example you have a black background for the anchor element, then you need to make it’s text color to white. Remove that 7:1 and add an actual color value.

I can give a hint for background color. The background of the anchor element is black.

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

And please mark the actual solution as solution of your problem. Thanks.

hey, thanks for your reply. as you have said, I have tried changing the color to the opposit to the background-color which you have told. but, even though I was targeting the anchor elements alone. the following is the message I was encountering while I was trying to run the code.
Sorry, your code does not pass. Don’t give up.
You should only change the color of a elements inside list elements.
the thing which wonders me here is, I was particularly targeting the anchor elements inside the list items. how would it effect the other elements. it should effect the anchor elements alone, since I am targeting it particularly by > method.

what is your code now?

I have changed nothing in my code, accept the value for the color property. I was targeting the anchor element in the same way as I have pasted my code above. no change. just as per the above suggestion, I have changed the color value from 7:1 to the actual opposit color. still I was encountering this error.

can you please copy all the code from the .css file?

sure I am pasting my code here.

body {
  background: #f5f6f7;
  color: #1b1b32;
  font-family: Helvetica;
  margin: 0;
}

header {
  width: 100%;
  height: 50px;
  background-color: #1b1b32;
  display: flex;
}

#logo {
  width: max(10rem, 18vw);
  background-color: #0a0a23;
  aspect-ratio: 35 / 4;
  padding: 0.4rem;
}

h1 {
  color: #f1be32;
  font-size: min(5vw, 1.2em);
}

nav {
  width: 50%;
  max-width: 300px;
  height: 50px;
}

nav > ul {
  display: flex;
  justify-content: space-evenly;
}

nav > ul > li {
  color: #dfdfe2;
  margin: 0 0.2rem;
  padding: 0.2rem;
  display: block;
}


li > a {
    color: white;
}

h1,
h2 {
  font-family: Verdana, Tahoma;
}

h2 {
  border-bottom: 4px solid #dfdfe2;
}

h3::before {
  content: "Question #";
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

@ILM I have tried all those work arounds which you have mentioned. none of them works for me. this happened to me in previous form building challenge as well. but, luckily, I was able to complete it till 98%, in this scenario I was not even close. please could you suggest me any alternatives for me if possible? thanks.

all of them? you tried a different browser? you tried updating your current browser? you deactivated all browser extensions?

anyway if you can’t complete this step, move on to step 47

yes I have done everything menntioned by you. but nothing really worked, and I use no extensions. I use to use one or two, but I have disabled them long ago.