Hallo,
ich habe hier ein Problem mit dem padding bei einer Linkliste...
Das Menü teilt sich auf in Kategorien, Items und SubItems.
Damit eine Hierarchie erkennbar ist, möchte ich gerne entsprechend einrücken. Das mache ich über padding... Im IE funktioniert das, im Mozilla allerdings leider nicht. Dort wird der TExt zwar ausgerichtet, aber die Box auch gleichzeitig um das Padding verbreitert... das ist blöd Andere Browser habe ich noch nicht getestet. Im Anhang habe ich mal ein paar Screenshots angehängt damit ihr seht, was ich meine. Links ist jeweils der IE in einer VMware und rechts ist Mozilla/Linux...
Das HTML sieht so aus:
Code:<div id="linkList"> <ul> <li class="headline">Kategorie 1</li> <li><a href="#" >Item 1</a></li> <li><a href="#" >Item 2</a></li> <li><a href="#" >Item 3</a></li> <li class="subitem"><a href="#" >SubItem 1</a></li> <li class="subitem"><a href="#" >SubItem 2</a></li> <li class="subitem"><a href="#" >SubItem 3</a></li> <li><a href="#" >Item 4</a></li> <li><a href="#" >Item 5</a></li> <li><a href="#" >Item 6</a></li> <li><a href="#" >Item 7</a></li> <li class="headline">Kategorie 2</li> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#" >Item 3</a></li> </ul> </div>
Das CSS ist so definiert:
Code:#linklist { display: block; margin: 0px; width: 150px; position: absolute; top: 170px; left: 20px; /* clip: rect(0px 150px auto 0px); */} #linklist ul li.headline { display: block; margin: 0px; width: 150px; padding: 2px 0px 2px 5px; border-bottom: 1px solid #0A0A0A; text-decoration: none; background: #D0D0D0; color: #0A0A0A; text-transform: UPPERCASE; font-weight: bold;} #linklist ul li a { display: block; margin: 0px; width: 150px; padding: 2px 0px 2px 10px; border-bottom: 1px solid #D0D0D0; text-decoration: none; background: #2B497B; color: #F2F2F2; text-transform: UPPERCASE;} #linklist ul li.subitem a{ display: block; margin: 0px; width: 150px; padding: 2px 0px 2px 15px; border-bottom: 1px solid #7A7A7A; text-decoration: none; background: #ADC1E1; color: #0A0A0A; text-transform: UPPERCASE;}
Als Workaround habe ich im #linklist-Layer ein Clipping gesetzt (s. o -> auskommentiert) , das einfach die Überstände abschneidet. Aber das ist keine saubere Lösung. Hat jemand eine Idee, wie ich das Problem beheben kann?
Gruß, Michael
Lesezeichen