Add an overlay to a background-image with one line of CSS

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUI6 min

About this video

Shows how to add a colour overlay on top of a background image in CSS, first with a pseudo-element, then with border-image and the fill keyword, ending in a one-line shorthand. Suited to front-end developers and designers who already write some CSS.

What you’ll learn

  • Compare a pseudo-element overlay with a border-image overlay
  • Use the fill keyword to keep a background image visible
  • Write a background image overlay as one line of CSS