Center a unordered list


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



Copy this code and paste it in your HTML
  1. .share ul{
  2. display:table;
  3. *display:inline-block;
  4. _display:inline-block;
  5. margin:20px auto 20px;
  6. }
  7.  
  8. .share li{
  9. display:table-cell;
  10. *display:inline;
  11. _display:inline;
  12. position:relative;
  13. background: #B4EBA2; /* old browsers */
  14. background: -moz-linear-gradient(top, #B4EBA2 0%, #8CCB79 100%); /* firefox */
  15. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#B4EBA2), color-stop(100%,#8CCB79)); /* webkit */
  16. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#B4EBA2', endColorstr='#8CCB79',GradientType=0 ); /* ie */
  17. padding:23px 22px 21px 21px;
  18. }
  19.  
  20. .share ul li{
  21. display:block;
  22. }
  23.  
  24. .share ul li a{
  25. *display:inline;
  26. _display:block;
  27. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.