CSS Alignment Within Box - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

CSS Alignment Within Box

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">
#main-container {<!--from  ww w  .  ja v  a2 s  . co  m-->
   width:100%;
   border:2px solid Chartreuse;
}

.img-div {
   width:51%
}

.img-div img {
   width:100%;
}

.rhs {
   width:49%;
   float:right;
   position:relative;
}

.button-nav {
   position:absolute;
   bottom:11px;
   width:100%;
}

.price {
   float:left;
}

.check-btn {
   float:right;
}
</style> 
 </head> 
 <body> 
  <div id="main-container"> 
   <div class="img-div"> 
    <img src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
   <div class="rhs"> 
    <div class="button-nav"> 
     <span class="price">Lorem </span> 
     <span class="check-btn"> <button>Lorem ipsum </button> </span> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials