Ga naar inhoud

CSS Table andere kleur bij mouse over.


anoniem

Aanbevolen berichten

ja, nou bijna.. je schrijft eigenlijk je css met javascript opnieuw weg adhv je eventhandler. Je hebt bijv [code:1:4996c16c58] <table style="background-color: black;"> [/code:1:4996c16c58] Dan kan je bij een td dit erachter plakken: [code:1:4996c16c58] [eventhandler]="this.style.backgroundColor='red'" [/code:1:4996c16c58] grtzz t.
Link naar reactie
<SCRIPT language=javascript> function NavRollOver(oTd) {if (!oTd.contains(event.fromElement)) {oTd.bgColor="#FFFF00";}} function NavRollOut(oTd) {if (!oTd.contains(event.toElement)) {oTd.bgColor="#CCCC66";}} // End Hiding --> </SCRIPT> <body text="#000000" bgcolor="#FFFFFF" link="#000066" vlink="#000066" alink="#FF0000"> <center> <table BORDER="0" WIDTH="10%" BGCOLOR="#CCCC66" HEIGHT="25"> <tr> <td onmouseover="NavRollOver(this)" onmouseout="NavRollOut(this)" height="22" bgcolor="#CCCC66"> <font face="Arial" size="2" color="#000000"> <b>2.&nbsp;<a href="bestand.html">Bestand</a><br> </font> </td> </tr> </table> </center> <br> </body> </html>
Link naar reactie
Zo kan het ook, misschien nog wel makkelijker, je kunt de style ook in een cascading stylesheet plaatsen. Verder werkt het veel overzichtelijker, maar dat is verder mijn mening. [code:1:28c83939a9] <html> <head> <style> .hoofdmenu { FONT: 12px "MS Sans Serif", Geneva, sans-serif; COLOR: #000000; BACKGROUND-COLOR: #CCCCCC; } .hoofdmenu A:link { COLOR: #000000; TEXT-DECORATION: none; } .hoofdmenu A:active { COLOR: #000000; TEXT-DECORATION: none; } .hoofdmenu A:visited { COLOR: #000000; TEXT-DECORATION: none; } .hoofdmenu A:hover { COLOR: #000000; TEXT-DECORATION: none; } .hoofdmenu_over { FONT: 9px "MS Sans Serif", Geneva, sans-serif; CURSOR: hand; COLOR: #ffffff; BACKGROUND-COLOR: #006699; } .hoofdmenu_over A { COLOR: #ffffff; TEXT-DECORATION: none; } .hoofdmenu_over A:link { COLOR: #ffffff; TEXT-DECORATION: none; } .hoofdmenu_over A:visited { COLOR: #ffffff; TEXT-DECORATION: none; } .hoofdmenu_over A:active { COLOR: #ffffff; TEXT-DECORATION: none; } </style> </head> <body> <table width="100%"> <tr> <td class="hoofdmenu" onmouseover="this.className='hoofdmenu_over'" onclick="top.hoofd.location.href='Home.htm'" onmouseout="this.className='hoofdmenu'"> Tekst </td> </tr> </table> </body> </html> [/code:1:28c83939a9]
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

  • Populaire leden

    Er is nog niemand die deze week reputatie heeft ontvangen.

  • Leden

    Geen leden om te tonen

×
×
  • Nieuwe aanmaken...