Center position fixed horizontally - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

Center position fixed horizontally

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style>
* {<!--from  w ww.  j a  va  2s .com-->
   margin:0;
   padding:0;
}

.bottom-fix {
   position:fixed;
   bottom:0;
   width:201px;
   height:51px;
   background:Chartreuse;
   left:51%;
   transform:translateX(-51%);
}
</style> 
 </head> 
 <body> 
  <div class="bottom-fix"></div>  
 </body>
</html>

Related Tutorials