Center align a div horizontally and bottom of the page


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. HTML:
  2. <div class="parent">
  3. <div class="child">
  4. Content here
  5. </div>
  6. </div>
  7.  
  8. CSS:
  9. .parent{
  10. position:fixed;
  11. bottom:0px;
  12. width:100%; //width should be 100%
  13. }
  14. .child{
  15. width:100px; //min width should give to center the div.
  16. margin:0px auto; //here it will make center
  17. }

URL: http://htmlcsstutorials.blogspot.com/2009/08/center-align-div-horizontally-and.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.