Effect How to - Create Borders with opacity








Question

We would like to know how to create Borders with opacity.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#box {<!--from  w  w w  . ja  v  a  2s . c  o m-->
  background-color: #ccc;
  line-height: 100px;
  height: 100px;
  vertical-align: middle;
}

#boxOuter {
  background: rgba(0, 0, 0, 0.5);
  width: 300px;
  padding: 10px;
  margin-left: 25px;
}


</style>
</head>
<body>
  <div id="boxOuter">
    <div id="box">THANK YOU!</div>
  </div>
  <br>

</body>
</html>

The code above is rendered as follows: