Responsively moving text inside of a div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsively moving text inside of a div

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">
body {<!-- w ww  .j a  v  a2  s .c  o  m-->
   width:100%;
}

h1 {
   margin:0;
}

.box-wrap {
   width:71%;
   background:red;
   height:351px;
}

.text-wrap {
   height:351px;
}

.text-wrap h1 {
   width:36%;
   position:relative;
   top:26%;
   background:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div class="box-wrap" style="background:red url() 50% 50% no-repeat;"> 
   <div class="img-wrap"> 
    <div class="text-wrap"> 
     <h1>Lorem ipsum d</h1> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials