Centralizar menu sem largura ( width without center menu )


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

Centralizar menu sem usar width


Copy this code and paste it in your HTML
  1. HTML:
  2.  
  3. <nav>
  4. <ul>
  5. <li><a href="#">Home</a></li>
  6. <li><a href="#">Article & Tutorials</a></li>
  7. <li><a href="#">Contact</a></li>
  8. </ul>
  9. </nav>
  10.  
  11.  
  12. CSS:
  13.  
  14. nav {
  15. overflow: hidden;
  16. }
  17. nav ul{
  18. list-style: none;
  19. float: left;
  20. position: relative;
  21. left: 50%;
  22. }
  23. nav ul li{
  24. float: left;
  25. position: relative;
  26. right: 50%;
  27. margin: 0 1px;
  28. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.