Ich habe mein mainmenu mit CSS formatiert und möchte einen Mouseover Background, welcher nur so breit wie das jeweilige Wort ist.
Um die Abstände schön einzustellen habe ich display:block; verwendet. Was aber dazu führt, dass die Hintergrundfarbe die Breite des übergeordneten DIV annimmt. Mit float: left würde es gehen, doch denn werden kurze Wörter auf einer Zeile angezeigt.![]()
So sieht das ganze aus:
http://server37.hostpoint.ch/~webgar...nt/view/17/30/
Und das CSS:
Code:a.mainlevel { color: #666; font-weight: bold; background-color: inherit; text-decoration: none; display: block; margin-top: 8px; } a.sublevel { color: #666; font-size: 8pt; margin-left: 6px; text-decoration: none; display: block; margin-top: 4px; background-color: #fff; padding: 0 1px 0 1px; } a.mainlevel:hover { color: #fff; text-decoration: none; background-color: #999933; } a.sublevel:hover { color: #fff; margin-left: 6px; text-decoration: none; background-color: #999933; }


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen