Ich habe ein horiziontales Top Menue, bei dem der Abstand der einzelnen Menüpunkte durch padding-right: xy definiert wird. Jetzt muss ich das aber beim letzten Menüpunkt abschaffen, weil das Menü sonst nicht mittig ausgerichtet wird.
So schauts bisher aus:
#menu li {float:left;padding-right:42px} #menu li a {display:block;font-size:16px;color:#afbfc7;text-decoration:none;line-height:37px;background:url(…/images/) top repeat-x;height:39px;overflow:hidden;cursor:pointer}
#menu {float:left;padding:45px 0 0 0}
#menu li {float:left;padding-right:50px}
#menu li:last-child {}
#menu li a {display:block;font-size:16px;color:#afbfc7;text-decoration:none;line-height:37px;background:url(../images/) top repeat-x;height:39px;overflow:hidden;cursor:pointer}
#menu li a span {display:block;background:url(../images/) top left no-repeat}
#menu li a span span {background:url(../images/) top right no-repeat;padding:0 0px;height:0px}
#menu li a:hover, #menu #menu_active a {color:#afbfc7;background:url(../images/) top repeat-x}
#menu li a:hover span, #menu #menu_active a span {background:url(../images/) top left no-repeat}
#menu li a:hover span span, #menu #menu_active a span span {background:url(../images/) top right no-repeat}
#menu .nav3 a:hover, #menu .nav3#menu_active a {background:url(../images/) top repeat-x}
#menu .nav3 a:hover span, #menu .nav3#menu_active a span {background:url(../images/) top left no-repeat}
#menu .nav3 a:hover span span, #menu .nav3#menu_active a span span {background:url(../images/) top right no-repeat}
#menu .nav4 a:hover, #menu .nav4#menu_active a {background:url(../images/) top repeat-x}
#menu .nav4 a:hover span, #menu .nav4#menu_active a span {background:url(../images/) top left no-repeat}
#menu .nav4 a:hover span span, #menu .nav4#menu_active a span span {background:url(../images/) top right no-repeat}
#menu .nav5 a:hover, #menu .nav5#menu_active a {background:url(../images/) top repeat-x}
#menu .nav5 a:hover span, #menu .nav5#menu_active a span {background:url(../images/) top left no-repeat}
#menu .nav5 a:hover span span, #menu .nav5#menu_active a span span {background:url(../images/) top right no-repeat}
Das Padding des letzten Menüpunktes (ganz rechts) wollte ich auch 0 setzen. Klappt aber nicht, weil dein Code auch das Padding der mittleren Menüpunkte eliminiert.
Das Padding des letzten Menüpunktes (ganz rechts) wollte ich auch 0 setzen. Klappt aber nicht, weil dein Code auch das Padding der mittleren Menüpunkte eliminiert.