In this article, we will use HTML and CSS to set the image in the text background. To set the image in the text background, some CSS property is used.
HTML Code: HTML code is used to create a basic structure of the body. In the following code, we will use paragraph tag to write text content.
CSS Code: The CSS property is used to set the image as background in the text. The background-image property is used to set an image as background. The -webkit-text-fill-color property is used to give the text a transparent color, the background image will show through the text, thus completing the clipping effect.
Complete Code: In this section, we will combine the above two sections to add an image as text background.
- How to give text or an image transparent background using CSS?
- How to Create a Wave Image for a Background using HTML and CSS ?
- How to wrap the text around an image using HTML and CSS ?
- How to place text on image using HTML and CSS?
- How to use text as background using CSS ?
- Set the opacity only to background color not on the text in CSS
- Set the size of background image using CSS ?
- CSS | background-image Property
- How to stretch and scale background image using CSS?
- How to change the background image using jQuery ?
- How to Rotate Container Background Image using CSS ?
- JQuery | Setting background-image using CSS property
- CSS | Combine background image with gradient overlay
- How to change background color of canvas-type text using Fabric.js ?
- Text Animation with changing the color of the text using HTML & CSS
- How to Vertically Align Text Next to an Image using CSS ?
- Convert an image into grayscale image using HTML/CSS
- How to place text in an image at any desired position ?
- Image Replacement in Bootstrap using text-hide Class
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.