Email layout to simulate absolute positioning - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Email layout to simulate absolute positioning

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
  <style>
#news-wrapper {<!--from  w  ww  .j av  a 2  s  . c  o m-->
   margin:0 auto;
   width:100%;
   max-width:601px;
   font-family:Arial, Helvetica, sans-serif;
   position:relative;
}

#news-head {
   height:118px;
   padding:51.6px;
   position:relative;
   background-color:Chartreuse;
}

.heading {
   width:100%;
   max-width:341px;
}

.heading h1 {
   color:yellow;
   font-weight:301;
   background-color:blue;
   padding:10.6px;
   font-size:25px;
   margin-top:0;
   margin-bottom:0;
   margin-left:auto;
   margin-right:auto;
   font-stretch:condensed;
}

.image-container {
   width:100%;
   max-width:264px;
   margin-top:-51px;
   margin-right:4%;
   position:relative;
   right:0;
   float:right;
}

#news-body {
   width:100%;
   max-width:556px;
   margin-top:0;
   margin-bottom:0;
   margin-left:auto;
   margin-right:auto;
}

p.default {
   color:pink;
   font-size:17px;
   font-weight:301;
   line-height:2.82;
}
</style> 
 </head> 
 <body> 
  <div id="news-wrapper"> 
   <div id="news-head"> 
    <div class="heading"> 
     <h1>Lorem ipsum dolor sit amet,</h1> 
    </div> 
   </div> 
   <div class="image-container"> 
    <img src="https://www.java2s.com/style/demo/Opera.png" alt=""> 
   </div> 
   <div id="news-body"> 
    <div style="margin-top: 120px;margin-bottom: 34px"> 
     <h2 style="color: #713235; font-weight: 300; text-indent: 35px;">Lorem ipsum dolor sit ame</h2> 
     <p class="default" style="text-indent: 35px;">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, p</p> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials