HTML & CSS · Junior · Question 62 of 75

How does opacity: 0.5 on a card differ from background: rgb(0 0 0 / 0.5)?

Explanation

Use alpha in colors when only the background should be see-through. Note that opacity below 1 also creates a new stacking context.

Further reading

Problem with a question

HTML & CSS · Junior · question 62

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz