0
0
CSSmarkup~10 mins

Group selectors in CSS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A,
B+
C~
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using combinators like + or > instead of a comma.
Leaving no space or separator between selectors.
2fill in blank
medium

Complete 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'
A>
B,
C~
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using combinators like + or > instead of a comma.
Forgetting the space after the comma.
3fill in blank
hard

Fix 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'
A,
B+
C~
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using combinators instead of a comma.
Missing the space after the comma.
4fill in blank
hard

Complete 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'
Anav
Bfooter
C,
Dsection
Attempts:
3 left
💡 Hint
Common Mistakes
Using a combinator instead of a comma.
Mixing up element names.
5fill in blank
hard

Fill 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'
Aarticle
B,
Caside
Dheader
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting commas between selectors.
Using combinators instead of commas.