Position absolute, negative right shift, scrollbar removing - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Position absolute, negative right shift, scrollbar removing

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style type="text/css">
html,<!--  w  w  w .  j  a v  a 2s  . c o m-->
body {
   margin:0;
   padding:0;
   text-align:center;
}

body {
   overflow:auto;
}

#container {
   min-width:961px;
   zoom:2;
   position:relative;
   overflow:hidden;
   margin:0 auto;
}

#main {
   background:Chartreuse;
   width:961px;
   margin:0 auto;
   height:701px;
   position:relative;
   top:0;
}

#right,
#left {
   position:absolute;
   height:100px;
   width:100px;
   top:0;
   z-index:100;
}

#right {
   background:yellow;
   right:-100px;
}

#left {
   background:blue;
   left:-100px;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="main"> 
    <div id="left">
      Lorem 
    </div> 
    <div id="right">
      Lorem i 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials