0
0
CSSmarkup~10 mins

!important usage 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 make the text color red using !important.

CSS
p { color: red[1]; }
Drag options to blanks, or click blank then click option'
Aimportant
B!important
C!important;
D!important !
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the semicolon after !important
Writing !important without the exclamation mark
2fill in blank
medium

Complete the code to override the background color with !important.

CSS
div { background-color: blue[1] }
Drag options to blanks, or click blank then click option'
A;
Bimportant;
C!important
D!important;
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the semicolon after !important
Writing important without the exclamation mark
3fill in blank
hard

Fix the error in the CSS to correctly apply !important to font-size.

CSS
h1 { font-size: 2rem[1] }
Drag options to blanks, or click blank then click option'
A!important;
B!important
C;
Dimportant;
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out the semicolon after !important
Writing important without the exclamation mark
4fill in blank
hard

Complete the code to make the paragraph text green and override other styles using !important.

CSS
p { color: green[1] ; }
Drag options to blanks, or click blank then click option'
A!important;
B;
C!important
Dimportant;
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the semicolon before !important
Writing !important with a semicolon attached
5fill in blank
hard

Fill both blanks to set border width to 3px and make it important with correct syntax.

CSS
div { border-width: 3px[1] [2] ; }
Drag options to blanks, or click blank then click option'
Aimportant
B!important
C;
D!!important
Attempts:
3 left
💡 Hint
Common Mistakes
Writing !!important which is invalid
Omitting the semicolon at the end