Style a button with :hover and :active - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Button

Description

Style a button with :hover and :active

Demo Code

ResultView the demo in separate window

<!doctype html>
<html>
 <head> 
  <meta http-equiv="X-UA-Compatible" content="IE=Edge"> 
  <title>Active Button</title> 
  <style type="text/css">
.button {<!--   w  ww  . j a v a  2  s . com-->
   padding:5px 13px;
   border:2px solid Chartreuse;
   background-color:yellow;
}

.button:hover {
   background-color:blue;
}

.button:active {
   background-color:pink;
   color:WhiteSmoke;
}

.frame {
   padding:3em;
}
</style> 
 </head> 
 <body> 
  <div class="frame"> 
   <button class="button">I'm a Button</button> 
  </div>  
 </body>
</html>

Related Tutorials