Center text inside an input button - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button

Description

Center text inside an input button

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Page Title</title> 
 </head> <!--  w ww.ja  v  a 2  s  . com-->
 <body> 
  <style>

.blankbtn
{
   text-align:center;
   font-size:20px;
   width:150px;
   height:150px;
   background-image: url(https://www.java2s.com/style/demo/InternetExplorer.png);
   background-repeat:no-repeat;
   word-wrap: break-word;      /* IE 5.5-7 */
   white-space: -moz-pre-wrap; /* Firefox 1.0-2.0 */
   white-space: pre-wrap;      /* current browsers */
}

      </style> 
  <input type="button" value="heres a long text" class="blankbtn">  
 </body>
</html>

Related Tutorials