Add a layer of div to achieve the function of transparent background:
Code:
<style>
.backgrounddiv{
margin: 40 auto;
text-align: center;
line-height: 200px;
width: 800px;
height: 500px;
background-image:url('img33.jpg');
background-size:cover;
}
.transparent{
width: 800px;
height: 500px;
background: rgba(255, 255, 255, 1);
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div class="backgrounddiv">
<div class="transparent">
<p>Text</p>
</div></div>
</form>
</body>
In general, background: rgba(255, 255, 255, 1), the last element 1 is opaque and 0 is transparent.
But here we achieve the transparency of the picture by the transparency and opacity of the white background color. The picture is transparent when the background is white and opaque. This makes it transparent when the value is '1' and opaque when the value is '0'. Of course, this has to do with your background color.
Best regards,
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.