0
0
CSSmarkup~5 mins

Background color in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What CSS property is used to change the background color of an element?
The background-color property is used to set or change the background color of an element.
Click to reveal answer
beginner
How do you set a background color to blue using CSS?
Use background-color: blue; inside a CSS rule to make the background blue.
Click to reveal answer
beginner
Can you use color names, hex codes, and RGB values with background-color?
Yes! You can use color names like red, hex codes like #ff0000, or RGB values like rgb(255, 0, 0) to set background colors.
Click to reveal answer
intermediate
What happens if you set background-color: transparent;?
The background becomes see-through, showing whatever is behind the element.
Click to reveal answer
beginner
Why is it important to consider contrast when choosing a background color?
Good contrast between background and text colors helps people read easily and improves accessibility for everyone.
Click to reveal answer
Which CSS property changes the background color of an element?
Acolor
Bbackground-color
Cfont-color
Dborder-color
How would you write CSS to make the background color red using a hex code?
Abackground-color: #ff0000;
Bcolor: #ff0000;
Cbackground: red;
Dbackground-color: rgb(0,0,255);
What does background-color: transparent; do?
AAdds a border
BSets background to white
CChanges text color
DMakes the background invisible
Which color format is NOT valid for background-color?
Afont(12px)
Brgb(255, 255, 255)
Cblue
D#00ff00
Why should you choose background and text colors with good contrast?
ATo use more colors
BTo slow down the website
CTo make text easier to read
DTo hide the text
Explain how to change the background color of a webpage using CSS.
Think about the CSS property and how you write a rule for the body element.
You got /3 concepts.
    Why is it important to consider accessibility when choosing background colors?
    Think about how colors affect how easy it is to see text.
    You got /3 concepts.