Hey, I am working on the Book Inventory App in the Full-Stack Developer Curriculum. I am having a hard time getting the last few criteria met.
The criteria is:
You should use an attribute selector to target the first descendant of span elements that have one as a part of their class value and set its background-image property to use a linear-gradient.
You should use an attribute selector to target the first two descendants of span elements that have two as a part of their class value and set their background-image property to use a linear-gradient.
You should use an attribute selector to target the three span elements that are descendants of span elements that have three as a part of their class value and set their background-image property to use a linear-gradient.
The display is showing that I am selecting the spans as desired but I am not meeting the criteria which is preventing me from completing the lab. Not sure if there is something I am missing or maybe this is a possible bug?
@ruelastech7 Your code won’t pass as tests don’t expect you to use :first-of-type or :nth-of-type but only :first-child and nth-child.
I will open a PR to fix it.
Edit: I can add that the tests require you to select span elements that have the wordone or two as a part of their class value. Meaning that it should be a white-space separated value, and not simply contained in the class value.
Thank you @Dario_DC. Changing * to ~ worked for the last two tests, selecting all of the descendants in a span containing “three”. The other two tests aren’t working still, even after changing it to child instead of type.
:nth-child(2) won’t work since the test case is looking for the first two descendants, not the second descendant. I have tried for the first two tests: :first-of-type, :first-child and :nth-child(1). For the second set of tests: :nth-of-type(-n+2) and :nth-child(-n+2).
// running tests
46. You should have an attribute selector to target the first descendant of span elements that have one as a part of their class value.
47. You should use an attribute selector to target the first descendant of span elements that have one as a part of their class value and set its background-image property to use a linear-gradient.
48. You should have an attribute selector to target the first two descendants of span elements that have two as a part of their class value.
49. You should use an attribute selector to target the first two descendants of span elements that have two as a part of their class value and set their background-image property to use a linear-gradient.
// tests completed
this one, without specifying span in front of :nth-of-child(1)
here you need to make it a selector list that targets both the first and second child. Same here without specifying span (also a limitation of the test)