Zum Inhalt springen

Zweistufiges Menü mit mehreren Farben

Erstellt am 24. September 2008 · 3 Antworten · letzte Antwort am 25. September 2008

Tags: Frage

spinne84 ·

Hallo miteinander,

ich möchte ein zweistufiges Menü erstellen, dass unter jedem einzelnen Menüpunkt eine separate Farbe hat.

Bild: tsv-essingen-fussball.de/…/menue.png

Ich bekomme die Menüpunkte nicht auseinander und lediglich eine Farbe unter alle Menüpunkte. Mein TS- und CSS-Code sieht folgendermaßen aus:

MENU = HMENU
			MENU {
				special = directory
				special.value = 4

				1 = TMENU
				1 {
					expAll = 1
		  	 	wrap = <ul id="nav">|</ul>
					noBlur = 1
					NO = 1
					NO.wrapItemAndSub = <li>|</li>
					
					IFSUB = 1
					IFSUB.wrapItemAndSub = <li class="menuparent">|</li>
					ACTIFSUB < .IFSUB
				}
				2 < .1	
				2.wrap = <ul>|</ul>
	
				3 < .2
		  	4 < .2
			}

Mein CSS dazu sieht so aus:

#nav, #nav ul {
	float: left;
	width: auto;
	list-style: none;
	line-height: 1em;
	background: transparent;
	color: #ffffff;
	font-weight: bold;
	padding: 0;
	border: solid #00009a;
	border-width: 0 0 5px 0;
	margin: 0 0 1em 0;
}
 
#nav a {
	display: block;
	width: auto;
	color: #ffffff;
 
	text-decoration: none;
	padding: 0.25em 0em;
}
 
#nav a.menuparent  {
	background: url(arrow.gif) no-repeat 90% 40%;
}
 
#nav li {
	float: left;
	padding: 0;
	width: auto;
}
 
#nav li ul {
	position: absolute;
	left: -999em;
	height: auto;
	width: 14em;
	font-weight: normal;
	border-width: 0.25em;
	margin: 0;
		
}
 
#nav li li {
 
	width: 14em
}
 
#nav li ul a {
	width: 14em;
	padding-left: 1em;
}
 
#nav li ul ul {
	margin: -1.75em 0 0 14em;
}
 
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul {
	left: -999em;
}
 
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
	left: auto;
}
 
#nav li:hover, #nav li.sfhover {
	background: #eda;
	color: white;
}

Ich habe auch schon versucht das Menü durch eine Tabelle zu erstellen. Leider ohne Erfolg. Wäre nett, wenn jemand einen Tipp für mich hätte.

Viele Grüße,
Spinne84

spinne84 ·

Hallo,

danke für die Antwort!
Mit dem optionSplit bin ich nicht zurecht gekommen.
Ich habe das Ganze etwas anderst versucht. Die verschiedenen Farben im Menü habe ich hinbekommen. Doch leider nur als einstufiges Menü.
Ich bin mir nicht sicher, ob das jetzt nur noch an den CSS Einstellungen liegt oder ob der TS-Code noch falsch ist. Wie müsste den der CSS Code für das zweistufige Menü aussehen?

# MENU erstellen
MENU = HMENU
MENU {
     special = directory
     special.value = 4
                            
     1 = TMENU
     1 {
        expAll = 1
	noBlur = 1
        NO = 1
        NO.linkWrap = <ul><li id="first">| || <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <li id="second">| || <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <li id="third">| || <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <li id="fourth">| || <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <li id="fifth">| || <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li id="sixth">|<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ul>

	 IFSUB = 1
         IFSUB.wrapItemAndSub = <li id="menuparent">|</li>
         ACTIFSUB < .IFSUB
	}
        2 < .1	
	2.wrap = <ul>|</ul>
	3 < .2
	4 < .2
}

Ein Ausschnitt der CSS-Datei. Die weiteren id´s (second, third, ...) sind genauso aufgebaut.

#first {
float: left; /* SEHR WICHTIG, DAMIT IM IE 7 DER BORDER ANGEZEIGT WIRD */
background: transparent;
color: #ffffff;
border-bottom-width: 5px;
border-bottom-style: solid;
border-color: #00009a;
}

#first a {
   	text-decoration: none;
   	color: #ffffff;
}

Vielen Dank,
Spinne84