Center align buttons inside Float:left div - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button layout

Description

Center align buttons inside Float:left div

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

div { height: 45px; }
div.side {<!--  w  ww .  ja v a2s  .co m-->
   background-color: skyblue;
   width: 120px;
   float: left;
   text-align: center;
   line-height: 45px;
}
div#range {
   background-color: tomato;
   width: 216px;
   float: left;
}
span {
   width:100%;
   text-align: center;
   display: block;
   margin: 3px auto;
}


      </style> 
 </head> 
 <body> 
  <div id="start" class="side"> 
   <button type="button">Click Me!</button> 
  </div> 
  <div id="range"></div> 
  <div id="end" class="side"> 
   <button type="button">Click Me!</button> 
  </div>  
 </body>
</html>

Related Tutorials