Center abs pos box inside already centered wrapper - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Center abs pos box inside already centered wrapper

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">
.main {<!-- w w w. jav a2s . c  om-->
   height:301px;
   background:lightgrey;
   display:flex;
}

.wrapper {
   margin:0 auto;
}

.dropdown {
   position:relative;
   color:Chartreuse;
   background:blue;
   text-align:center;
}

.dropdown a {
   display:block;
}
</style> 
 </head> 
 <body> 
  <div class="main"> 
   <div class="wrapper"> 
    <a>Lorem</a> 
    <div class="dropdown"> 
     <a>Lorem ipsum</a> 
     <a>Lorem ipsum dolor sit amet</a> 
     <a>Lorem ipsum dolo</a> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials