Question using a selector?

Hello fcc open forum,

I am having difficulty identifying the correct selector for step 57 in the Building a Registration Form. Would you please see my CSS code below and assist me?

Step 57

Last, but not least, change the text color of the terms and conditions link to #dfdfe2 .


a[name="terms"] {
  font-color: #dfdfe2;```
*index.html portion being referenced*
<input type="checkbox" name="terms" class="inline" required /> I accept the <a href="" target="_blank">terms and conditions</a>

:heavy_multiplication_x: Sorry, your code does not pass. Don’t give up.

You should use an a element selector.

There is no such CSS property named font-color.

1 Like

I tried to use text-color and it did not work. I received the same hint. Is there another attribute that I should be using within the brackets after the a element selector?

Well, I see you specifying name = terms, but isn’t terms the name of the input checkbox, not the terms and conditions link item?

If that is the only anchor tag on the page, you could just select the achor tag to add the color to.

Think back to the Cat Photo App. What CSS property was used to change the text color in that project?

I have tried to reference a[href=“target_blank”] with color: as the property but I am still receiving the same error message. Is the href properly being referenced or is there another attribute that I should try using?

Your <a> tag doesn’t seem to have an href =“target_blank”… the href in your code is "…". Look at your <a> tag, and decide what you’d like to use to select it.

The [attribute="value"] selector is used to select elements with a specified attribute and value.

The value of the href attribute in your code is :


And the value for the target attribute is _blank.

So try and correct this :

I have inputted the following into CSS and the ‘terms and conditions’ link turned white:
a[href=“freeCodeCamp's Terms of Service”] {
color: #dfdfe2;

However; the condition is still not passing. What should I consider inputting in order to have it pass the code check?

Cause in the challenge you were only asked to use an a element selector.

Not attribute selectors.

Thanks . I have corrected the omission.

1 Like

Haha, I have been strugglinging with this last step too.
I’ve tried:
a [href=“freeCodeCamp's Terms of Service”]
{color: #dfdfe2;}
and the color did change but FCC did not let me pass.
Until I just tried:
a { color: #dfdfe2;}
and I’ve passed.
So I guess, FCC asked us only to use a element selector and not attribute selectors. Or was the first solution (a [href=…) wrong?
Sorry, I am new here

Last step, I was stomped until I noticed this last post.

a {color: #dfdfe2;} 

Great. That’s it. Thanks a lot. :grinning:

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