0
0
CSSmarkup~10 mins

Element 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 all <p> elements and make their text red.

CSS
p [1] 
  color: red;
}
Drag options to blanks, or click blank then click option'
A{
B[
C(
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets or parentheses instead of curly braces.
Forgetting the opening brace after the selector.
2fill in blank
medium

Complete the code to select all <h1> elements and set their font size to 2rem.

CSS
h1 [1] 
  font-size: 2rem;
}
Drag options to blanks, or click blank then click option'
A(
B{
C[
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses or brackets instead of curly braces.
Omitting the opening brace.
3fill in blank
hard

Fix the error in the code to select all <li> elements and make their text bold.

CSS
li [1] 
  font-weight: bold;
}
Drag options to blanks, or click blank then click option'
A{
B(
C[
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong brackets or missing the opening brace.
Placing the brace on the wrong line.
4fill in blank
hard

Complete the code to select all <a> elements and remove their underline.

CSS
a { 
  text-decoration: [1];
}
Drag options to blanks, or click blank then click option'
A{
Bnone
Cunderline
D(
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of curly braces.
Setting text-decoration to 'underline' instead of 'none'.
5fill in blank
hard

Fill both blanks to select all <h2> elements, set color to blue, and add margin of 1rem.

CSS
h2 { 
  color: [1];
  margin: [2];
}
Drag options to blanks, or click blank then click option'
A{
Bblue
C1rem
D(
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong brackets to open the block.
Using incorrect color names or units for margin.