Zum Inhalt springen

LI anklickbar?

Erstellt am 10. Oktober 2008 · 4 Antworten · letzte Antwort am 10. Oktober 2008

Tags: Frage

tobyte ·

Evtl könnt ihr mir weiterhelfen. Auf meiner Seite www.tobraun.de befindet sich auf der linken Seite eine Navigation, welche ich über ein Text Menü bzw. LI gelöst habe

css:
ul.navigation {padding:0; margin:0; list-style-type:none;}
ul.navigation li { background-color:#505050; border-bottom:8px solid #fff; margin:0 0 10px 0; padding:10px 0 10px 15px; color:#fff; font-weight:bold;}
ul.navigation li.act { background-color:#fff; border-bottom:8px solid #505050; color:#505050;}
ul.navigation li:hover {background-color:#2e2e2e;}
ul.navigation li.act:hover {background-color:#efefef;}

ul.navigation li a {color:#fff; text-decoration:none;}
ul.navigation li.act a {color:#505050;}

wie kann ich es realisieren, dass die Navigation auf einen Klick auf der gesamten LI reagiert?

tobyte ·

danke erstmal für den Tipp, die Änderungen die ich vorgenommen habe:

ul.navigation {padding:0; margin:0; list-style-type:none; display:block;}
ul.navigation li a {color:#fff; text-decoration:none; padding:10px 80px 10px 0;}

nun ist der Bereich, welcher anklickbar ist, größer geworden. Allerdings brechen jetzt lange Seitennamen, welche aus 2 Wörtern bestehen, ggf. um. Ich muss allerdngs gestehen, dass ich nicht genau weiss was du mit passing meinst, aber es wird wohl padding sein?

just2b ·

ja padding natürlich... habs im posting ausgebessert

sonst schaus dir zB auf just2b.com an oder jeder anderer seite mit listenmenü

georg

tobyte ·

danke nohmal, nun ist es so wie es sein soll.

css:
ul.navigation {padding:0; margin:0; list-style-type:none;}
ul.navigation li { background-color:#505050; border-bottom:8px solid #fff; margin:0 0 10px 0; color:#fff; font-weight:bold;}
ul.navigation li.act { background-color:#fff; border-bottom:8px solid #505050; color:#505050;}
ul.navigation li:hover {background-color:#2e2e2e;}
ul.navigation li.act:hover {background-color:#efefef;}

ul.navigation li a {color:#fff; text-decoration:none; padding:10px 80px 10px 15px; display:block;}
ul.navigation li.act a {color:#505050;}