Zum Inhalt springen

Linkfarbe ändern

Erstellt am 24. Mai 2007 · 1 Antwort · letzte Antwort am 25. Mai 2007

Tags: Frage

Beaver78 ·

Folgende CSS-Code habe ich geschrieben

<html>
<style type="text/css">
.gelbbox { background-color:#f6c500; color:#173486;   }
.weissbox{  color:#FFFFFF;   }
a:link { font-weight:bold; color:#FFFFFF; text-decoration:none; }
a:visited { font-weight:bold; color:#FFFFFF; text-decoration:none; }
a:hover { font-weight:bold; color:green; text-decoration:none; }

</style>
</html>

An bei folgt das Typoschript Template:

 seite = PAGE
 seite {
 typeNum = 0
 bodyTag = <body bgColor = "#173486">
 stylesheet = fileadmin/style.css
 meta.AUTHOR = Dirk Jakobeit
 meta.DESCRIPTION = Hier steht eine Beschreibung
   10 = IMAGE
  10.file = fileadmin/blau.jpg 
 20 = TEMPLATE
 20.template = FILE
 20.template.file = fileadmin/test.htm
  
20.workOnSubpart = DOKUMENT



 20.marks {


  

 
 MENU_OBEN = HMENU
 MENU_OBEN.special = directory
 MENU_OBEN.special.value = 98
 MENU_OBEN.1 = TMENU
 MENU_OBEN.1.expAll=1 

 MENU_OBEN.1.ATagParams = COLOR: black;
 MENU_OBEN.1.NO.linkWrap = <div class="gelbbox">&nbsp;|</div>
 MENU_OBEN.2 = TMENU
 MENU_OBEN.2.expAll=1 
 MENU_OBEN.2.ATagParams = COLOR: black;
 MENU_OBEN.2.NO.linkWrap = <div class=weissbox>&nbsp;|</div>

CONTENT = CONTENT
 CONTENT {
 table = tt_content
 select.orderBy = sorting
 select.where = colPos = 0
lib.stdheader >
 lib.stdheader = CASE
 lib.stdheader {
 key.field = header_layout
 1 = TEXT
 1.field = header
 1.wrap = <font face="Arial" size="2"><b> | </b></font><br>
 default < .1
108 }

 tmp_tt_content_text < tt_content.text
 tt_content.text >
 tt_content.text = COA
 tt_content.text.10 < lib.stdheader
 tt_content.text.20 = TEXT
 tt_content.text.20 {
 field = bodytext
 fieldRequired = bodytext
 wrap = <font face="Arial" size="2">|</font><br>
 parseFunc < tmp_tt_content_text.20.parseFunc
 editIcons < tmp_tt_content_text.20.editIcons
 }

 }

}
 }

Gerne möchte ich die First-Level-Links mit Gelben Kasten und blauerschrift darstellen.
Die Second-Level-Links möchte in der Farbe weiss darstellen.

Die Blauefarbe wird dargestellt leider die weisse nicht!
Was könnte der Fehler sein?

Gruß
Dirk

febo ·

Hi Beaver78,

mit dem CSS ist das schon so eine Sache. Wenn man da erstmal einen Fehler drin hat, sucht man manchmal lange.

Folgenden Lösungsvorschlag hätte ich für dich. Hier ein Beispiel.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
  .gelbbox {
    background-color:#f6c500;
	color:#173486;
	padding-left: 5px;
  }
  .weissbox{
    background-color:#f6c599;
    color:#FFFFFF;
	padding-left: 25px;
  }
  a:link { font-weight:bold; color:#FFFFFF; text-decoration:none; }
  a:visited { font-weight:bold; color:#FFFFFF; text-decoration:none; }
  a:hover { font-weight:bold; color:green; text-decoration:none; }

  .gelbbox a:link { font-weight:bold; color:#404040; text-decoration:none; }
  .gelbbox a:visited { font-weight:bold; color:#404040; text-decoration:none; }
  .gelbbox a:hover { font-weight:bold; color:green; text-decoration:none; }

  .weissbox a:link { font-weight:bold; color:#808080; text-decoration:none; }
  .weissbox a:visited { font-weight:bold; color:#808080; text-decoration:none; }
  .weissbox a:hover { font-weight:bold; color:green; text-decoration:none; }
  
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<div class="gelbbox"><a href="#" class="gelbbox">Level 1 Link Eins</a></div>
<div class=weissbox><a href="#" class="weissbox">Level 2 Link Eins</a></div>
<div class=weissbox><a href="#" class="weissbox">Level 2 Link Zwei</a></div>
<div class="gelbbox"><a href="#" class="gelbbox">Level 1 Link Zwei</a></div>
</body>
</html>

Über den TS Parameter ATagParams übergebe ich folgenden Wert:
ATagParams = class="gelbbox" bzw. class="weissbox". Somit erhalte ich oben stehende Links. Über CCS weise ich den Links nun neue Werte zu.

Versuchs mal.

Gruß

febo