Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select both <p> and <h1> elements with one rule.
CSS
p[1]h1 { color: blue; } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using combinators like + or > instead of a comma.
Leaving no space or separator between selectors.
✗ Incorrect
and
are selected together by separating them with a comma in CSS group selectors.
2fill in blank
mediumComplete the code to apply the same style to <h2> and <h3> elements.
CSS
h2[1]h3 { font-weight: bold; } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using combinators like + or > instead of a comma.
Forgetting the space after the comma.
✗ Incorrect
A comma groups selectors so the style applies to both and
and .
3fill in blank
hardFix the error in the group selector to style both <div> and <section> elements.
CSS
div[1]section { margin: 1rem; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using combinators instead of a comma.
Missing the space after the comma.
✗ Incorrect
A comma is needed to group selectors correctly; combinators like + cause errors here.
4fill in blank
hardComplete the code to select <nav> and <footer> elements and set their background color.
CSS
[1], footer { background-color: #eee; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a combinator instead of a comma.
Mixing up element names.
✗ Incorrect
Use 'nav' and a comma to group selectors; 'footer' is an option but not used here.
5fill in blank
hardFill both blanks to select <article>, <aside>, and <header> elements and set their font size.
CSS
[1], [2], header { font-size: 1.2rem; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting commas between selectors.
Using combinators instead of commas.
✗ Incorrect