How to add Image in Text Background using CSS?

coding_dev_
1 min readJan 9, 2023

--

Hey, how are you?

This is my third blog & it’s going amazing! Today we will make a text that contains an image as it’s background. Like this,

But, why to make a text like this?

Well, because it looks cool and beautiful!

Let’s get started!

  1. Body of our code i.e., HTML:
<!DOCTYPE html>
<html>
<head>
<title>Text with Image as background</title>
</head>
<body>
<p>Good Morning</p>
</body>
</html>

2. Style the text with CSS:

p {
background-image: url(image url); /* Put any image that looks beautiful */
background-repeat: repeat;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;

/* Text styling for example */
font-size: 8rem;
text-align: center;
font-weight: bold;
text-transform: uppercase;
font-family: Sans-Serif;
font-weight: 800;
}

That’s it. I hope you have made it successfully!

Thanks for Reading, see you soon😊

Don’t forget to like and follow for more…

Instagram: @coding_dev_

Support: https://www.buymeacoffee.com/codingdev

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

coding_dev_
coding_dev_

Written by coding_dev_

I'm Tilak, and I'm currently pursuing MCA. I enjoy sharing tips and tricks on web development!

Responses (1)

Write a response