Half-image half-color responsive background - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Half-image half-color responsive background

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ipsu</title> 
  <style>
.full-width {
   position:relative;
   width:100%;
}

.half-background:after {
   background-color:Chartreuse;
   content:"";<!--  ww  w  .  ja  va 2  s. c  o m-->
   display:block;
   height:100%;
   position:absolute;
   top:0;
   right:0;
   width:51%;
   pointer-events:none;
}

.site-width-limit {
   width:1081px;
   margin:0 auto;
}

.col-wrapper {
   display:block
}

.col {
   box-sizing:border-box;
   display:inline-block;
   margin-right:4%;
   vertical-align:top;
   width:100%;
   color:yellow;
   font-family:sans-serif;
   line-height:31px;
   padding:31px 0;
}

.col.col-1-2 {
   width:49.32%
}

.col-wrapper .col:last-child {
   margin-right:0
}

@media screen and (max-width:1160px)  {
   .site-width {
      background:red;
      margin:0 6%;
      width:91%;
   }

}
</style> 
 </head> 
 <body translate="no"> 
  <div class="full-width half-background" style="background-image:url('http://vwwgroup.com/wp-content/uploads/2016/03/stock-photo-64109767-three-generation-family-enjoying-a-summer-vacation-together_web_new.jpg')"> 
   <div class="site-width-limit"> 
    <div class="col-wrapper"> 
     <div class="col col-1-2">
       Lorem ips 
     </div> 
     <div class="col col-1-2">
       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 s 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials