Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][CSS] Jak wyśrodkować zawartość <li> ?
-wasilek-
post 10.05.2008, 06:22:32
Post #1





Goście







Mam taki css:

Kod
#menu
{

    width: 100%;
    top: 0em;
    left: 0em;
    background: #3EED2C;
    height: 4.5em;
}

#menu ul
{
    list-style: none;
    bottom: 0em;
    left: 1em;
}

#menu li
{
    display: block;
    float: left;
}

#menu li a
{
    color: #fff;
    display: block;
    padding: 0.75em 1.25em 1.25em 1.25em;
    text-decoration: none;
}

#menu li a:hover
{
    background: #39A404;
}



A html mam taki:

Kod
<div id="menu">
    <ul>
        <li><a href="#">Mwenu</a></li>
        <li><a href="#">Mwenu</a></li>
        <li><a href="#">Mwenu</a></li>
        <li><a href="#">Mwenu</a></li>
    </ul>
</div>


Co zmienic w css zeby wszystkie linki byly wycentrowane a nie po lewej stronie? Gdy w #menu li daje float: center; to nie dziala i wszystkie linki sie pokazuja pionowo zamiast poziomo ;/
Go to the top of the page
+Quote Post
baranek77
post 10.05.2008, 07:04:44
Post #2





Grupa: Zarejestrowani
Postów: 66
Pomógł: 7
Dołączył: 17.12.2007

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


  1. #menu li {
  2. text-align:center;
  3.  
  4. }
Go to the top of the page
+Quote Post
-wasilek-
post 10.05.2008, 07:20:36
Post #3





Goście







Niestety, ale nadal te linki sa po lewej stronie ;/ Sam sobie nie umie z tym poradzic juz od 4 nad ranem winksmiley.jpg
Go to the top of the page
+Quote Post
baranek77
post 10.05.2008, 07:53:36
Post #4





Grupa: Zarejestrowani
Postów: 66
Pomógł: 7
Dołączył: 17.12.2007

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


a mzoe
  1. #menu li a{text-align:center;}
jezeli nie sprobuj mzoe wycentrowac marginesami li

Ten post edytował baranek77 10.05.2008, 07:53:56
Go to the top of the page
+Quote Post
-wasilek-
post 10.05.2008, 08:06:07
Post #5





Goście







Niestety to tez nie dziala.. Co masz na mysli "wycentrowac marginesy li"?
Go to the top of the page
+Quote Post
baranek77
post 10.05.2008, 08:41:12
Post #6





Grupa: Zarejestrowani
Postów: 66
Pomógł: 7
Dołączył: 17.12.2007

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


chodzilo ci o wycentrowanie calego menu tak ?
  1. #menu ul
  2. {
  3. margin:0px 25% 0px 25%;
  4. list-style: none;
  5. bottom: 0em;
  6. left: 1em;
  7. }
Go to the top of the page
+Quote Post
woj_tas
post 10.05.2008, 08:42:44
Post #7





Grupa: Zarejestrowani
Postów: 230
Pomógł: 36
Dołączył: 31.03.2006
Skąd: Zielona Góra

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


  1. #menu
  2. {
  3.  
  4. width: 100%;
  5. top: 0em;
  6. left: 0em;
  7. background: #3EED2C;
  8. height: 4.5em;
  9. }
  10.  
  11. #menu ul
  12. {
  13. list-style: none;
  14. bottom: 0em;
  15. left: 1em;
  16. text-align:center;
  17. height:50px;
  18. line-height:42px;
  19. }
  20.  
  21. #menu li
  22. {
  23. display: inline;
  24.  
  25. }
  26.  
  27. #menu li a
  28. {
  29. color: #fff;
  30. display: inline;
  31. padding: 0.75em 1.25em 1.25em 1.25em;
  32. text-decoration: none;
  33. }
  34.  
  35. #menu li a:hover
  36. {
  37. background: #39A404;
  38. }


Ten post edytował woj_tas 10.05.2008, 08:43:00


--------------------
Go to the top of the page
+Quote Post
-wasilek-
post 10.05.2008, 08:45:13
Post #8





Goście







Teraz jest wysrodkowane, ale nie wyswietlaja sie wszystkie pozycje.... ;/ Nie wiem kombinuje od samego poranka i nic nie pomaga;/
Go to the top of the page
+Quote Post
baranek77
post 10.05.2008, 08:46:59
Post #9





Grupa: Zarejestrowani
Postów: 66
Pomógł: 7
Dołączył: 17.12.2007

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


jak sie nie wyswietlaja wszystkie to zmniejsz margines i juz;]
Go to the top of the page
+Quote Post
-wasilek-
post 10.05.2008, 08:47:41
Post #10





Goście







winksmiley.jpg przyznajcie wj_tas`owi pomógł.. dzięki pomogło winksmiley.jpg
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 13.07.2025 - 00:52