---
title: "Text-/Linkfarbe per CSS ändern (TMENU -> ACT)"
url: "https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act"
source: "typo3.net"
tags: ["TYPO3","Menüs","Frage"]
created: "2003-08-13"
last_reply: "2003-08-26"
replies: 8
solved: false
page: 1
pages: 1
lang: "de"
---

# Text-/Linkfarbe per CSS ändern (TMENU -> ACT)

TYPO3 › Menüs · 8 Antworten · gestartet 2003-08-13

## Eröffnungsbeitrag

**vanessa** · 2003-08-13 · [Beitrag #1](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/1)

Hallo,

folgendes Problem: in einem TMENU soll der aktuelle Punkt mit einem Highlight versehen werden. Ich tausche per wrap die CSS-Klassen aus und möchte so eine andere Textfarbe und einen anderen Hintergrund erreichen. Der Hintergrund wird auch geändert, der Text leider nicht.

hier ein code-snippet:

```typoscript
# MAIN NAV

  marks.NAV = HMENU
  marks.NAV.entryLevel = 0
  marks.NAV.1 = TMENU
  marks.NAV.1 {
  NO {
  allWrap = <TD onMouseOver="this.bgColor='#B475B2'" onMouseOut="this.bgColor='#F1F1F1'" class="nav" align="center">|</TD><TD><IMG SRC="fileadmin/templates/design_template/images/blank.gif" width="5" height="1"></TD>
  }
#MAIN NAV HIGHLIGHT
  ACT < .NO 
  ACT = 1 
  ACT { 
      ATagParams = class="navOn"
      allWrap = <TD bgcolor="#B475B2" align="center" class="navOn">|</TD><TD><IMG SRC="fileadmin/templates/design_template/images/blank.gif" width="5" height="1"></TD>
   } 
  }
```

Die Textfarbe wird nicht weiß angezeigt (class=navOn), sondern weiterhin grau (class=nav). Schreibe ich direkt in den wrap noch etwas hinein, etwa so:

```typoscript
ACT { 
      ATagParams = class="navOn"
      allWrap = <TD bgcolor="#B475B2" align="center" class="navOn">TEST-TEXT|</TD><TD><IMG SRC="fileadmin/templates/design_template/images/blank.gif" width="5" height="1"></TD>
```

so wird dieser Text wie gewünscht weiß dargestellt. Meine Menüpunkte allerdings nicht :(

Im Quelltext erscheint die Klassenzuweisung übrigens ganz nach Plan:

```html
<TD bgcolor="#B475B2" align="center" class="navOn"><A HREF="index.php?id=4" onFocus="blurLink(this);" class="navOn">Fachinfos</A></TD>
```

Ich hatte es kurz schonmal soweit, dass es funktionierte. Es ging dann aber leider wieder "kaputt" und ich kann es nicht rekonstruieren..

Weiß jemand Rat?

## Antworten

### [#2](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/2) · freeman2000 · 2003-08-13

Servus,

wie sieht denn dein CSS-Code aus?

Viele Grüße,
Oliver Moser

### [#3](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/3) · vanessa · 2003-08-18

Hallo,

meine CSS-Classes sehen so aus:

```css
.nav {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#706F6F;
			font-weight:bold;
			text-decoration:none;
                                                text-align:bottom;
			}

.navOn {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:20px;
			color:#FFFFFF;
			font-weight:bold;
			text-decoration:none; 
			padding:0px; 
			margin:0px; 
                                                text-align:bottom;
			}

.navOn a {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#FFFFFF;
			font-weight:bold;
			text-decoration:none; 
			padding:0px; 
			margin:0px; 
                                                text-align:bottom;
			}

.navOn a:hover {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#FFFFFF;
			font-weight:bold;
			text-decoration:none; 
			padding:0px; 
			margin:0px; 
                                                text-align:bottom;
			}


.nav a:hover{
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#FFFFFF;
			font-weight:bold;
			text-decoration:none;
			background-color:#B475B2; 
			padding:0px; 
			margin:0px; 
                                                text-align:bottom;
			}	

.nav a {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#706F6F;
			font-weight:bold;
			text-decoration:none;
                                                text-align:bottom;
			}
```

Wie du siehst, habe ich ziemlich viel ausprobiert. Daran sollte es *eigentlich* nicht liegen.

Danke für Hilfe

### [#4](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/4) · freeman2000 · 2003-08-20

Hi,

probier es doch mal bei den Links mit folgendem CSS-Aufbau:

```css
a.nav:link {
         font-family:Tahoma,Arial,Sans-Serif; 
         font-size:9px; 
         color:#FFFFFF; 
         font-weight:bold; 
         text-decoration:none; 
         background-color:#B475B2; 
         padding:0px; 
         margin:0px; 
}
```

Klappt's?

Viele Grüße,
Oliver Moser

### [#5](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/5) · vanessa · 2003-08-25

Hallo Oliver,

danke für den Tipp, leider klappt es damit auch nicht.  *schulternzuck*

Das witzige ist, dass bei mouseover die Schrift ja wieder im gewünschten weiß angezeigt wird. Nur beim ACT funzt das ganze nicht.

Ich probiers weiter...

### [#6](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/6) · doku · 2003-08-25

> **vanessa schrieb:**
>
> Hallo Oliver,
>
> danke für den Tipp, leider klappt es damit auch nicht.  *schulternzuck*
>
> Das witzige ist, dass bei mouseover die Schrift ja wieder im gewünschten weiß angezeigt wird. Nur beim ACT funzt das ganze nicht.
>
> Ich probiers weiter...

benutzt du frames?

### [#7](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/7) · vanessa · 2003-08-25

nein, keine frames oder sonstiger schnick-schnack.

### [#8](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/8) · freeman2000 · 2003-08-25

Hi Vanessa,

also ich bin mir sicher, dass die CSS-Angaben falsch sind. Ich habe den TS-Code für die CSS-Angaben genauso und bei mir klappt das. Der Quelltext sieht auch gut aus.

Kann man sich die Seite irgendwo im Netz angucken?

Viele Grüße,
Olli

### [#9](https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act/9) · vanessa · 2003-08-26

Hallo,

ich habe nochmal rumprobiert mit dem CSS-Code von dir und siehe da - es klappt jetzt!

```css
a.nav {
         font-family:Tahoma,Arial,Sans-Serif;
         font-size:9px;
         color:#FFFFFF;
         font-weight:bold;
         text-decoration:none;

         padding:0px;
         margin:0px;
}

a.nav:link {
         font-family:Tahoma,Arial,Sans-Serif;
         font-size:9px;
         color:#FFFFFF;
         font-weight:bold;
         text-decoration:none;
         padding:0px;
         margin:0px;
}

.nav {
         font-family:Tahoma,Arial,Sans-Serif;
         font-size:9px;
         color:#706F6F;
         font-weight:bold;
         text-decoration:none;
         text-align:bottom;
}

.nav a {
         font-family:Tahoma,Arial,Sans-Serif;
         font-size:9px;
         color:#706F6F;
         font-weight:bold;
         text-decoration:none;

         padding:0px;
         margin:0px;
}

.nav a:hover {
         font-family:Tahoma,Arial,Sans-Serif;
         font-size:9px;
         color:#FFFFFF;
         font-weight:bold;
         text-decoration:none;

         padding:0px;
         margin:0px;
}



.navOn {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#FFFFFF;
			font-weight:bold;
			text-decoration:none; 
			padding:0px; 
			margin:0px; 
                                                text-align:bottom;
			}

.navOn a {
			font-family:Tahoma,Arial,Sans-Serif;
			font-size:9px;
			color:#FFFFFF;
			font-weight:bold;
			text-decoration:none; 
			padding:0px; 
			margin:0px; 
                                                text-align:bottom;
			}


a.navOn:link {
         font-family:Tahoma,Arial,Sans-Serif;
         font-size:9px;
         color:#FFFFFF;
         font-weight:bold;
         text-decoration:none;
         padding:0px;
         margin:0px;
}
```

Das mit der wechselnden Hintergrundfarbe mache ich jetzt über JS:

```html
<TD onMouseOver="this.bgColor='#B475B2'" onMouseOut="this.bgColor='#F1F1F1'" class="nav" align="center"><A HREF="index.php?id=7" onFocus="blurLink(this);">Diagnostik</A></TD>
```

Vielen Dank für die Hilfe!

---

Quelle: „Text-/Linkfarbe per CSS ändern (TMENU -> ACT)“, typo3.net, https://www.typo3.net/d/4874-text-linkfarbe-per-css-aendern-tmenu-act
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
