Remove the default padding from a button - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button style

Description

Remove the default padding from a button

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">

button::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner {
   padding: 0 !important;
   border: 0 none !important;
}
div {<!--   w w  w .ja  va 2s.  co  m-->
   height: 300px;
   width: 300px;
   background-color: red;
}
button {
   padding: 0px;
   margin: 0px;
   color: inherit;
   border: 0;
   background-color: blue;
}
span {
   background-color: yellow;
   display: block;
   width: 100%;
}


      </style> 
 </head> 
 <body> 
  <div> 
   <button> <span>span</span> </button> 
  </div>  
 </body>
</html>

Related Tutorials