With CSS add transparency to a button

CSSWeb DevelopmentFront End Technology

To add transparency to a button, use the CSS opacity property. This creates a disabled look for the button.

You can try to run the following code to add transparency to a button

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         .btn1 {
            color: black;
            text-align: center;
            font-size: 15px;
         }
         .btn2 {
            color: black;
            text-align: center;
            font-size: 15px;
            opacity: 0.8;
         }
      </style>
   </head>
   <body>
      <h2>Result</h2>
      <p>Click below for result:</p>
      <button class = "btn1">Enabled</button>
      <button class = "btn2">Disabled</button>
   </body>
</html>
raja
Published on 24-May-2018 12:40:35
Advertisements