Create a transparent box with CSS

CSSWeb DevelopmentFront End Technology

To create a transparent box with CSS, you can try to run the following code

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            background-color: #808000;
            padding: 20px;
         }
         div.myopacity {
            opacity: 0.4;
            filter: alpha(opacity=80);
         }
      </style>
   </head>
   <body>
      <h1>Heading</h1>
      <p>Check trensparency in the below box:</p>
      <div class = "myopacity">
         <p>opacity 0.4</p>
      </div>
      <div>
         <p>opacity 1</p>
      </div>
   </body>
</html>
raja
Published on 09-May-2018 12:31:03
Advertisements