Lower the opacity of a background-image with CSS

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

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

IntermediateWeb DesignUI7 min

About this video

Shows how to fade a background image in CSS without fading the content on top of it, by placing the image on a pseudo-element and adjusting its opacity. It also covers a more maintainable way to structure the code.

What you’ll learn

  • Lower the opacity of a background image without affecting child content
  • Create and position a pseudo-element to hold a background image
  • Structure background image styles so they are easier to maintain