Lorem ipsum dolor sit amet, an his etiam torquatos.
HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Learn how to create an image with a transparent (see-through) background text using CSS
Lorem ipsum dolor sit amet, an his etiam torquatos.
Try it Yourself »
Step 1) Add HTML:
<div class="container">
<img src="notebook.jpg"
alt="Notebook" style="width:100%;">
<div class="content">
<h1>Heading</h1>
<p>Lorem ipsum..</p>
</div>
</div>
Step 2) Add CSS:
.container {
position: relative;
max-width: 800px;
/* Maximum width */
margin: 0 auto; /* Center it */
}
.container .content {
position: absolute; /* Position the background text */
bottom: 0;
/* At the bottom. Use top:0 to append it to the top */
background:
rgb(0, 0, 0); /* Fallback color */
background: rgba(0, 0, 0, 0.5);
/* Black background with 0.5 opacity */
color: #f1f1f1;
/* Grey text */
width: 100%; /* Full width */
padding: 20px;
/* Some padding */
}
Try it Yourself »