Avatar

How to make a background-image transparent in CSS

youtube.com

By Coder Coder on youtube.com

More about this content:

In this step, you'll learn how to put a background image on an HTML div while also containing text or other content without changing the opacity of the text or child elements of the div. To do this, you'll need to use a pseudo element to separate the background image from the parent and set it to an absolute position. You'll also need to set the parent to position relative and the text element to position relative so that it'll be on top of the pseudo element. Finally, you'll need to set the content property of the pseudo element to an empty string. With these steps, you'll have a beautiful and legible background image with text on top.

Visit

Join related learning paths