Center a button under 3 divs - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button layout

Description

Center a button under 3 divs

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

#div1 {<!-- ww w . jav a2 s  . c o  m-->
   background-color: red;
   width: 100px;
   height: 100px;
   margin-right: 10px;
}
#div2 {
   background-color: green;
   width: 100px;
   height: 100px;
   margin-right: 10px;
}
#div3 {
   background-color: blue;
   width: 100px;
   height: 100px;
}
#squares {
   display: flex;
   position: relative;
   justify-content: center;
}
#button {
   width: 100px;
   height: 50px;
   clear: both;
   margin: 0 auto;
}


      </style> 
 </head> 
 <body> 
  <div id="squares"> 
   <div id="div1"></div> 
   <div id="div2"></div> 
   <div id="div3"></div> 
  </div> 
  <div id="button"> 
   <button>Click me!</button> 
  </div>  
 </body>
</html>

Related Tutorials