How to make the text background transparent but not the text itself with CSS?

Spread the love

To make the text background transparent but not the text itself with CSS, we set the background property.

For instance, we write

.content {
  padding: 20px;
  width: 710px;
  position: relative;
  background: rgba(204, 204, 204, 0.5);
}

to set the background of the elements with class content to rgba(204, 204, 204, 0.5).

This will make the background translucent.

Leave a Reply

Your email address will not be published. Required fields are marked *