Text in Transparent Box using CSS3

To set text in transparent box with CSS3, the code is as follows −


 Live Demo

<!DOCTYPE html>
body {
   font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
.transparentBox {
   background: url("https://i.picsum.photos/id/249/1000/300.jpg") repeat;
   border: 2px solid black;
.transparentText {
   margin: 30px;
   background-color: #ffffff;
   border: 1px solid black;
   opacity: 0.6;
.transparentText p {
   margin: 5%;
   font-weight: bolder;
   color: #000000;
   font-size: 20px;
<h1>Text in transparent box example</h1>
<div class="transparentBox">
<div class="transparentText">
<p>This is some random text inside the transparent box</p>


The above code will produce the following output −