5 hands-on exercises and 5 find-the-bug challenges for the CSS Attribute Selectors lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Style any element that has a data-role attribute.
Style elements whose data-role is exactly primary.
Style elements whose data-role starts with "prim".
Style elements whose data-role ends with "ary".
Style elements whose data-role contains "rima".
Attribute selectors need square brackets.
The value in the selector does not match the markup.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceA prefix match uses ^=, not =^.
^= matches the start of the value; a suffix match needs $=.
Values containing dashes must be quoted.