Add a transparent gradient over a solid background to create a button out of anchor - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Button

Description

Add a transparent gradient over a solid background to create a button out of anchor

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>semi-transparent gradient</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div {<!--from w w w  . j  a  v  a 2  s  .com-->
   background:red;
}

a.btn {
   color:Chartreuse;
   display:block;
   text-align:center;
   font-weight:bold;
   text-decoration:none;
   padding:11px 0px;
   background:-webkit-gradient(linear, left top, left bottom, from(yellow), to(rgba(0, 0, 0, 2)), color-stop(2,black));
}
</style> 
 </head> 
 <body> 
  <div> 
   <a class="btn">button</a> 
  </div>  
 </body>
</html>

Related Tutorials