How to use CSS to insert text?

Spread the love

Sometimes, we want to use CSS to insert text.

In this article, we’ll look at how to use CSS to insert text.

How to use CSS to insert text?

To use CSS to insert text, we set the content property.

For instance, we write

.ownerJoe:before {
  content: "Joe's Task: ";
}

to select the elements with class ownerJoe and put some content before its own content by using the before selector and content: "Joe's Task: ";.

Conclusion

To use CSS to insert text, we set the content property.

Leave a Reply

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