<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
.container {
position: relative;
max-width: 800px;
margin: 0 auto;
}
.container img {vertical-align: middle;}
.container .content {
position: absolute;
bottom: 0;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
width: 100%;
padding: 20px;
}
</style>
</head>
<body>
<h5>Responsive Image with Transparent Text</h5>
<div class="container">
<img src="trial.jpg" alt="background" style="width:100%;">
<div class="content">
<h1>Heading</h1>
<p>Sample Text here Sample Text hereSample Text hereSample Text hereSample Text hereSample Text here.</p>
</div>
</div>
</body>
</html>
in above example if you observe class 'content' which text overlay and transparent view using background: rgba(0, 0, 0, 0.5);
RGBA - set opacity of rgb(red, green, blue) color , in above 0.5 means transparent to background up to half.