Make Button shrink using CSS - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button style

Description

Make Button shrink using CSS

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

.demo {<!--  ww  w. j a  v a2 s  . c o  m-->
   background: yellow; /* Old browsers */
   background: -moz-linear-gradient(top,  yellow 0%, #dddddd 100%); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,yellow), color-stop(100%,#dddddd)); /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(top,  yellow 0%,#dddddd 100%); /* Chrome10+,Safari5.1+ */
   background: -o-linear-gradient(top,  yellow 0%,#dddddd 100%); /* Opera 11.10+ */
   background: -ms-linear-gradient(top,  yellow 0%,#dddddd 100%); /* IE10+ */
   background: linear-gradient(to bottom,  yellow 0%,#dddddd 100%); /* W3C */
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='yellow', endColorstr='#dddddd',GradientType=0 ); /* IE6-9 */
   border: 1px solid #dddddd;
   padding: 5px;
   font-size: 18px;
   margin: 20px;
   cursor: pointer;
}
.demo:active {
   background: #dddddd; /* Old browsers */
   background: -moz-linear-gradient(top,  #dddddd 0%, yellow 99%); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(99%,yellow)); /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(top,  #dddddd 0%,yellow 99%); /* Chrome10+,Safari5.1+ */
   background: -o-linear-gradient(top,  #dddddd 0%,yellow 99%); /* Opera 11.10+ */
   background: -ms-linear-gradient(top,  #dddddd 0%,yellow 99%); /* IE10+ */
   background: linear-gradient(to bottom,  #dddddd 0%,yellow 99%); /* W3C */
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dddddd', endColorstr='yellow',GradientType=0 ); /* IE6-9 */
   border: 1px solid transparent;
}


      </style> 
 </head> 
 <body> 
  <input type="button" class="demo" value="Press Me">  
 </body>
</html>

Related Tutorials