Use Opacity and color together - HTML CSS CSS

HTML CSS examples for CSS:Color

Description

Use Opacity and color together

Demo Code

ResultView the demo in separate window

<html>
   <head>
      <style>
         #m1 {background-color:rgb(255,0,0);opacity:0.6;}
         #m2 {background-color:rgb(0,255,0);opacity:0.6;}
         #m3 {background-color:rgb(0,0,255);opacity:0.6;}
      </style>
   </head><!--  ww  w  .ja v a2 s  . c  o m-->
   <body>
      <p>HSLA colors:</p>
      <p id="m1">Red</p>
      <p id="m2">Green</p>
      <p id="m3">Blue</p>
   </body>
</html>

Related Tutorials