Having 2 responsive Divs Side By side - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Having 2 responsive Divs Side By side

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">
.post-reg-columns {
   width:100%;
   display:block;
}

.firstcolumn {<!--  w w  w.  j  av  a2 s  .  c  o  m-->
   display:inline-block;
   max-width:41%;
   padding:11px;
}

.firstcolumn button {
   color:Chartreuse;
   background-color:yellow;
   text-shadow:-2px 2px blue;
   border:none;
   font-size:2.5em;
   font-family:'Bree Serif', serif;
   font-weight:bold;
   width:100%;
   padding:16px;
}

.firstcolumn button:hover {
   background-color:pink;
}

.secondcolumn {
   display:inline-block;
   background:OrangeRed;
   max-width:41%;
   margin:6%;
   padding:11px;
}
</style> 
 </head> 
 <body> 
  <div class="post-reg-columns"> 
   <div class="firstcolumn"> 
    <div class="title2">
      Lorem ipsum dol 
    </div> 
    <a href="http://google.com"> <button>Lorem ipsum</button> </a>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, 
   </div> 
   <div class="secondcolumn">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semper sit amet purus quis ornare. Quisque lobortis neque vitae tempor iaculis. Aliquam erat volutpat. Mauris tincidunt eg 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials