Bug in "Show it if you know it"?


I think there is a bug in the "visualizer" screen on the right side of the page for this exercise: https://www.codecademy.com/en/courses/web-beginner-en-WF0CF/3/5?curriculum_id=50579fb998b470000202dc8b

This is what I have in my CSS. But on the screen, only the 2nd link has a changed color, not the 3rd. I also tried changing the font-family. It also only affected the 2nd link.

     color: #FFC125;


can you post your html code?

did you use breaks? (<br>)? nth-child count all elements, but i need to see your code to be able to explain it properly


Yes, I used <br>.

   <a href="http://somelink.com">Link 1</a><br>
   <a href="http://notgoogle.com">Link 2</a><br>
   <a href="http://anotherlink.com">Link 3</a><br>


so break is now the second element, and the second link the third element. nth-child counts all elements, so it makes sense the second link get the color

So not really a bug?


interesting. didn't know that. thanks!

when I hit submit, it said that my code satisfied the requirements for that exercise. that was what gave me the impression that there was a bug.


yea, but here is the catch, lets say we have this:


and then do this:

p:first-child {color: red}

nothing will color red, since the first element is a h1 heading, not a paragraph

you wrote the required code in the css file, the code which has to be written is validate, if you add more (like breaks in html) this won't be validated


that makes sense, and I appreciate your clarification. the disjunction between what the exercise tells the user to accomplish, and what is validated in the code is still a little confusing. like when I do

a:nth-child(5) { color: #FFC125 }

I successfully changed color of the 3rd link, but it's not an acceptable answer. from a user experience perspective, the behavior of the app seems strange. and it's not just me. looks like other people have been baffled by the same thing. just wanted to provide this feedback in case you're interested.


Makes sense that the answer is not accepted? The problem is that if you allow all creativity from students (like adding breaks, and much more) the checking becomes impossible complex.

So added more content then the exercise asks for, so then a conflict between code validated by the exercise and the output arises, not much we can do about that.


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