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
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’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.
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.
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.
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.
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.
@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.
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.