Skip to content
Advertisement

Link Element Not Displaying When Selected And Styled As nth-of-type

https://codesandbox.io/s/damp-worker-k7fj6y?file=/src/App.js

Why is the .row:nth-of-type(1) > .content:nth-of-type(4) .content <Link/> not displaying?

Is it a bug, am I just missing something?

JavaScript
JavaScript

wheres the red content

I am not looking for an alternative approach to achieve the same result, I am simply asking why the fourth <Link/> is not displaying so I know what is going wrong.

Advertisement

Answer

Use the :nth-child psuedoselector since you are mixing element types (div and Link (a)), there isn’t a 4th link type element to style.

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement