Mousover für Tabellen in CSS funktioniert nicht

Status
Nicht offen für weitere Antworten.

Alexander Groß

Erfahrenes Mitglied
Hi, ich habe ein Forum in dem in der Übersicht Tabellen sind. Früher hatte ich einen Hack eingebaut der es erlaubte für in der CSS definierte Farben beim überfahren einer tabelle mit der Maus die Farbe zu wechseln. Jetz hab ich das Forum auf eine neue Version geuppt und wollte den Hack angepasst wieder einbauen. Er funktioniert aber nicht mehr. Es wird zwar die Hand angezeigt und man kommt auch mit einem Klick auf das jeweilige Forum, aber die Farbe wechselt nicht mehr beim überfahren.

Hier die Adresse von meinem Forum: http://www.foxo.de/ibf/index.php

Zur Ergänzung:

meine CSS:

Code:
form { display:inline }
TABLE, TR, TD { font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color: #000000 }
a:link, a:visited, a:active { text-decoration: underline; color: #000000 }
a:hover { color: #465584 }


.hlight { background-color: #DFE6EF }
.dlight { background-color: #EEF2F7 }
.mainbg { background-color: #FFFFFF }
.mainfoot { background-color: #BCD0ED }
.forum1 { background-color: #DFE6EF }
.forum2 { background-color: #E4EAF2 }
.post1 { background-color: #F5F9FD }
.post2 { background-color: #EEF2F7 }
.posthead { background-color: #E4EAF2 }

.postbak { background-color: #D2D2D0 }
.title { background-color: #C4DCF7 }
.row1 { background-color: #EEF2F7 }
.row2 { background-color: #F5F9FD }
.postsep { background-color: #C7D2E0; height: 1px }

.signature { font-size: 7.5pt; color: #333399 }
.postdetails { font-size: 7.5pt }
.postcolor, #postcolor { font-size: 9pt; line-height: 160% }
.membertitle { font-size: 10px; line-height: 150%; color: #000000 }
.normalname { font-size: 12px; font-weight: bold; color: #000033; padding-bottom: 2px }
.normalname a:link, .normalname a:visited, .normalname a:active { text-decoration: underline; color: #000033; padding-bottom: 2px }
.unreg { font-size: 11px; font-weight: bold; color: #990000 }
.highlight { color: #FF0000 }
.highlight a:link, .highlight a:visited, .highlight a:active { text-decoration: underline; color: #FF0000 }
.highlight a:hover { text-decoration: underline }
.desc { font-size: 8.0pt; color: #434951 }
.copyright { font-family: Verdana, Tahoma, Arial; font-size: 7.5pt; line-height: 12px }
.category { font-weight: bold; line-height: 150%; color: #4C77B6; background-color: #C2CFDF }
.category   a:link, #category   a:visited, #category   a:active { text-decoration: none; color: #4C77B6 }
.postfoot         {

    font-weight:bold;

    color:#3A4F6C;

    height: 24px;

    background-color: #D1DCEB;

}
.titlefoot { font-weight: bold; color: #3A4F6C; height: 24px; background-color: #BCD0ED }
.titlemedium         {

    font-weight:bold;
    color:#3A4F6C;

    height: 30px;

    background-color: #9FBCE3;
    
    background-image: url(style_images/<#IMG_DIR#>/tile_sub.gif);

}
.titlemedium  a:link,  .titlefoot  a:link, .titlemedium  a:visited, .titlefoot  a:visited, .titlemedium  a:active, .titlefoot  a:active { text-decoration: underline; color: #3A4F6C }
.titlemedium a:hover, .subtitle a:hover, .titlefoot a:hover { text-decoration: underline; color: #000000 }
.maintitle         {

    color:#000000;

    font-size: 9.5pt;
    
    height: 26px;
    
    background-image: url(style_images/<#IMG_DIR#>/tile_back.gif);

}
.edit { font-size: 9px }
.fancyborder { border: 1px dashed #999999 }
.solidborder { border: 1px solid #999999 }
.maintitle  a:link, .maintitle  a:visited, .maintitle  a:active { text-decoration: none; color: #000000 }
.maintitle a:hover { text-decoration: underline }
.nav { font-weight: bold; color: #000000; font-size: 8.5pt }
.pagetitle { color: #4C77B6; font-size: 18px; font-weight: bold; letter-spacing: -1px; line-height: 120% }
.useroptions { background-color: #598CC3; height: 25px; font-weight: bold; color: #FFFFFF }
.useroptions a:link, .useroptions a:visited,.useroptions a:active { text-decoration: none; color: #FFFFFF }
.bottomborder { border-bottom: 1px dashed #D2D2D0 }
.linkthru { color: #000000; font-size:8.5pt }
.linkthru  a:link, .linkthru  a:active { text-decoration: underline; color: #000000 }
.linkthru  a:visited { text-decoration: underline; color: #000000 }
.linkthru  a:hover { text-decoration: underline; color: #465584 }
#QUOTE { font-family: Verdana, Arial; font-size: 8pt; color: #333333; background-color: #FAFCFE; border: 1px solid Black; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px }
#CODE { font-family: Verdana, Arial; font-size: 8pt; color: #333333; background-color: #FAFCFE; border: 1px solid Black; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px }
.codebuttons { font-size: 8.5pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }
.forminput { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }
.textinput { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }
.input { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }

und der HTML Abschnitt in dem ich den Hover eingebaut habe:

Code:
<!-- Forum {$info['id']} entry -->
        <tr> 
          <td class="forum2" align="center">{$info['img_new_post']}</td>
          <td class="forum2" 



style="Cursor:Hand" onClick="window.location.href='{ibf.vars.board_url}/index.{ibf.vars.php_ext}?s={ibf.session_id}&act=SF&f={$info['id']}'" onMouseOver="this.id='forum1'" onMouseOut="this.id='forum2'"










width="59%"><span class="linkthru"><b><a href="{ibf.vars.board_url}/index.{ibf.vars.php_ext}?s={ibf.session_id}&act=SF&f={$info['id']}">{$info['name']}</a></b></span><br><span class='desc'>{$info['description']}</span><br>{$info['moderator']}</td>
          <td class="forum1" align="center" width="7%">{$info['topics']}</td>
          <td class="forum1" align="center" width="7%">{$info['posts']}</td>
          <td class="forum1" width="27%">{$info['last_post']}<br>{ibf.lang.in}: {$info['last_topic']}<br>{ibf.lang.by}: {$info['last_poster']}</td>
        </tr>
    <!-- End of Forum {$info['id']} entry -->

Ich hoffe Ihr könnt etwas damit anfangen.

A.
 
Zuletzt bearbeitet:
Erstmal bin ich mir nicht sicher ob es was bringt wenn man die ID ändert,wenn die Elemente schon eine feste Klasse zugewiesen bekommen haben.
Entweder du wechselst wirklich die Klasse,oder du arbeitest direkt mit style.bgcolor
 
Hmm, das ist für mich noch alles etwas Neuland. Kannst Du mir etwas genauer und einfacher erklären welche Möglichkeiten ich habe?

A.
 
Jo, mittlerweile habe ich es auch hinbekommen. Allerdings nicht so wie ich es eigentlich wollte. Ich musste in der CSS folgendes hinzufügen:

#hoover1 { background-color: #DFE6EF }
#hoover2 { background-color: #E4EAF2 }


dann habe ich den html code geändert

style="Cursor:Hand" onClick="window.location.href='{ibf.vars.board_url}/index.{ibf.vars.php_ext}?s={ibf.session_id}&act=SF&f={$info['id']}'"
onMouseOver="this.id='hoover1'"
onMouseOut="this.id='hoover2'"

So 100% zufrieden bin ich damit nicht. Mir wäre es lieber wenn ich die vorhandenen definitionen in der css verwenden könnte.

Also:


.forum1 { background-color: #DFE6EF }
.forum2 { background-color: #E4EAF2 }

mit dem .
und nicht einen zusätzlichen Eintrag
mit #

Wie kann ich das lösen?

A.
 
Status
Nicht offen für weitere Antworten.
Zurück