CSS Selectors Knowledge Quiz Form
Test your understanding of CSS selectors with a variety of question types. Please answer each question thoughtfully.
Your Name
First Name
Last Name
Which CSS selector targets all elements inside a ?
*
div p
div > p
.div p
p div
Other
Write a CSS selector that selects all elements with the class 'active' inside a element.
*
Explain the difference between the ".class" and "#id" selectors.
*
Which of the following selectors is most specific?
*
.menu li.selected
#menu .selected
ul.menu li
#menu li.selected
Rate your confidence in using attribute selectors (e.g., [type="text"]).
*
1
2
3
4
5
Match each selector to what it selects:
*
Rows
What it selects
a
All <a rel="nofollow"> elements</a>
All elements with class 'button'
All elements of type 'submit'
All <li> elements inside <ul></ul></li>
.button
All <a rel="nofollow"> elements</a>
All elements with class 'button'
All elements of type 'submit'
All <li> elements inside <ul></ul></li>
input[type='submit']
All <a rel="nofollow"> elements</a>
All elements with class 'button'
All elements of type 'submit'
All <li> elements inside <ul></ul></li>
ul li
All <a rel="nofollow"> elements</a>
All elements with class 'button'
All elements of type 'submit'
All <li> elements inside <ul></ul></li>
Which selector would select only the first in every ?
*
ul li:first-child
ul > li
.ul .li:first
li:first
Provide a CSS selector that targets all elements except those of type 'checkbox'.
*
Briefly describe a scenario where you would use a descendant selector.
*
Submit Quiz
Should be Empty: