Learn Accessibility by Building a Quiz - Step 46

Tell us what’s happening:

The tutor prompts described and used these codes with ‘>’ earlier, and Im wondering why it doesn’t work…

Your code so far

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

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

ul >li > a{
  color: white;
}

/* 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/129.0.0.0 Safari/537.36

Challenge Information:

Learn Accessibility by Building a Quiz - Step 46

I think they just didn’t expect you to define the ul first.
(the request was to select the anchors in the list element so they meant the li)

If ul > li > a works why isn’t it accepted, that seems to be the logic taught at the start…

Your suggestion works by the way, thanks. But im curious about the ul > li > a not being accepted…

in css, there are a huge multitude of ways to select the same set of elements.
For eg. Here are some valid methods:
ul > li > a
ul li a
nav > ul > li > a
nav a
ul a
li a
body li a

The test cannot realistically accept all valid answers for each step. It would not be possible for the developers to work out all the ways someone can answer correctly.
So that’s why your code didn’t work. Someone just didn’t think of this as a possible answer.

Thank you. You answered that quite perfectly

1 Like