Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][CSS]wyśrodkowanie menu
Michał90
post
Post #1





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

Ostrzeżenie: (0%)
-----


Witam,
Jak wyśrodkować menu, żeby było na środku?

  1. ul#topnav {
  2. margin: 0;
  3. padding: 0;
  4. list-style: none;
  5.  
  6. font-size: 1.1em;
  7. }
  8. ul#topnav li{
  9. margin: 0;
  10. padding: 0;
  11. overflow: hidden; /*--Important - Masking out the hover state by default--*/
  12. float: left;
  13. height:40px;
  14. }
  15. ul#topnav a, ul#topnav span { /*--The <a> and <span> share the same properties since the <span> will be a duplicate of the <a> tag--*/
  16. padding: 10px 20px;
  17. float: left;
  18. text-decoration: none;
  19. color: #fff;
  20. background: url(a_bg.gif) repeat-x;
  21. text-transform: uppercase;
  22. clear: both;
  23. width: 100%;
  24. height: 20px;
  25. line-height: 20px; /*--Vertical alignment of text--*/
  26. }
  27. ul#topnav a{ /*--This is basically the hover state of navigation--*/
  28. color: #555;
  29. background-position: center bottom;
  30. }
  31. ul#topnav span{ /*--Default state of navigation--*/
  32. background-position: center top;
  33. }
  34. #men {
  35.  
  36. width: 100%;
  37. height: 40px;
  38. background: url(a_bg.gif) repeat-x;
  39. }


  1. <div id="men">
  2. <ul id="topnav">
  3. <li><a href="#">Home</a></li>
  4. <li><a href="#">Services</a></li>
  5. <li><a href="#">Portfolio</a></li>
  6. <li><a href="#">Blog</a></li>
  7. <li><a href="#">About</a></li>
  8. <li><a href="#">Contact</a></li>
  9. </ul>
  10. </div>


Tak to wygląda:
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 02:36