Overlapping Images when making site Responsive - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Overlapping Images when making site Responsive

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">
.row {<!--  w  w  w  . j a v  a 2s .co m-->
   border:2px solid Chartreuse;
}

.row:before, .row:after {
   content:" ";
   display:table;
   clear:both;
}

.col-main {
   position:relative;
   border:2px solid yellow;
   float:left;
   width:49%;
   padding:11px;
   box-sizing:border-box;
}

.col-side {
   position:relative;
   border:2px solid blue;
   float:left;
   width:49%;
   padding:11px;
   box-sizing:border-box;
}

@media (max-width:480px)  {
   .col-side,
      .col-main {
      width:100%;
   }

}
</style> 
 </head> 
 <body> 
  <div class="row"> 
   <!-- MAIN CONTENT --> 
   <div class="col-main"> 
    <div class="img"> 
     <img src="https://www.java2s.com/style/demo/Firefox.png" alt="flower"> 
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor</p> 
    </div> 
   </div> 
   <!-- SIDE BAR --> 
   <div class="col-side"> 
    <p>Lorem ipsum </p> 
    <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt="events"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials