Cellules linkables et css

Fermé
boxfly Messages postés 17 Date d'inscription mardi 18 septembre 2001 Statut Membre Dernière intervention 11 août 2021 - 18 sept. 2001 à 20:46
boxfly Messages postés 17 Date d'inscription mardi 18 septembre 2001 Statut Membre Dernière intervention 11 août 2021 - 19 sept. 2001 à 14:33
Salut,

J'ai essayé sans résultat de changer la couleur du lien lorsque la souris va dans une cellule linkable.
La cellule est bien linkable (ici vers www.w3.org) et la couleur même de la cellule change bien quand la souris passe dessus mais la couleur du texte (un lien) ne change pas pour autant.
Voici la source du css:

<style type="text/css">
<!--
a.link_td {color:#000000;text-decoration: none;}
a:hover.link_td {color:#ffffff;text-decoration: none;}
// -->
</style>

<td align="Center"
onmouseover="this.style.background='grey' ;
this.style.border='1px outset' ;
this.style.a.color='#ffffff' ; "
onmouseout="this.style.background='#dddddd' ;
this.style.border='1px inset' ; "
onclick="window.location.href=' http://www.w3.org'">
<b><a class="link_td" href="www.w3.org">Cellule Linkable</a></b>
</td>



Donc la cellule passe de la couleur #dddddd à la couleur grey quand la souris est dessus mais le lien ne change pas vers le blanc.
J'ai également essayer des trucs du style:
this.style.a.link_td="'#ffffff' ; "
Pour surdéfinir le css link_td quand la souris passe dans la cellule mais rien n'y fait :(

Vous pouvez voir ce que donne cette cellule ici: http://boxfly.free.fr/test/

Toute aide est la bienvenue.

Merci.

3 réponses

Bobinours Messages postés 2898 Date d'inscription jeudi 26 avril 2001 Statut Membre Dernière intervention 21 mars 2013 504
19 sept. 2001 à 04:24
Ton style est incorect :

<html>
<style type="text/css">
<!--
a.link_td {color:#000000;text-decoration: none;}
a.link_td:hover {color:#ffffff;text-decoration: none;}
// -->
</style>

Ensuite il n'aime pas ton 'grey':

<table>
<td align="Center"
onMouseOver="this.style.background='#666666' ;
this.style.border='1px outset';"
onMouseOut="this.style.background='#dddddd' ;
this.style.border='1px inset' ; "
onclick="window.location.href = ' http://www.w3.org'">
<b><a class="link_td" href=" http://www.w3.org">Cellule Linkable</a></b>
</td>
</table>
</html>

-= Bobinours =-
0
boxfly Messages postés 17 Date d'inscription mardi 18 septembre 2001 Statut Membre Dernière intervention 11 août 2021 26
19 sept. 2001 à 11:43
Merci pour ma syntaxe qui était érronée.

Je me suis peut-être mal exprimé, ce que je voudrais c'est que la chaine de caractère 'Cellule linkable' passe vers le blanc quand la souris est dans la cellule sans pour autant être sur la chaîne de caractère.

Donc changer la couleur d 'Cellule lnkable' sans pour autant avoir la souris dessus, mais simplement dans a cellule.

C'est pour ca que j'ai mis this.style.a.color='#ffffff' ; " dans le onmouseover du td, mais ca marche pô...

++
Vincent.


L'URL: http://boxfly.free.fr/test/
0
boxfly Messages postés 17 Date d'inscription mardi 18 septembre 2001 Statut Membre Dernière intervention 11 août 2021 26
19 sept. 2001 à 14:33
Bon je me re-réponds pour dire que j'ai trouvé la solotion dans un newsgroup. En fait c'est faisable grâce à document.links[0].style.color='xxxxx'
L'url: http://boxfly.free.fr/test/

La source:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head type="text/css">
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
<title>TEST</title>
<style type="text/css">
<!--
a.link_td {color:#000000;text-decoration: none;}
a.link_td:hover {color:#ffffff;text-decoration: none;}
// -->
</style>
</head>
<body text="#ffffff" marginwidth="0" marginheight="0" topmargin="0"
leftmargin="0" bgcolor="#ffffff" link="#0000ee" vlink="#551a8b"
alink="#0000ee">
<br>
<br>
<div align="Center">
<table width="50%" border="1" bgcolor="#f0f0f0">
<tbody>
<tr>
<td align="Center"
onmouseover="this.style.background='#666666' ;
this.style.border='1px outset' ;
document.links[0].style.color='#ffffff' ; "
onmouseout="this.style.background='#dddddd' ;
this.style.border='1px inset' ;
document.links[0].style.color='#000000' ; "
onclick="window.location.href=' http://www.w3.org'">
<b><a class="link_td" href="www.w3.org">Cellule
Linkable</a></b>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

0
boxfly Messages postés 17 Date d'inscription mardi 18 septembre 2001 Statut Membre Dernière intervention 11 août 2021 26
19 sept. 2001 à 14:33
Bon je me re-réponds pour dire que j'ai trouvé la solotion dans un newsgroup. En fait c'est faisable grâce à document.links[0].style.color='xxxxx'
L'url: http://boxfly.free.fr/test/

La source:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head type="text/css">
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
<title>TEST</title>
<style type="text/css">
<!--
a.link_td {color:#000000;text-decoration: none;}
a.link_td:hover {color:#ffffff;text-decoration: none;}
// -->
</style>
</head>
<body text="#ffffff" marginwidth="0" marginheight="0" topmargin="0"
leftmargin="0" bgcolor="#ffffff" link="#0000ee" vlink="#551a8b"
alink="#0000ee">
<br>
<br>
<div align="Center">
<table width="50%" border="1" bgcolor="#f0f0f0">
<tbody>
<tr>
<td align="Center"
onmouseover="this.style.background='#666666' ;
this.style.border='1px outset' ;
document.links[0].style.color='#ffffff' ; "
onmouseout="this.style.background='#dddddd' ;
this.style.border='1px inset' ;
document.links[0].style.color='#000000' ; "
onclick="window.location.href=' http://www.w3.org'">
<b><a class="link_td" href="www.w3.org">Cellule
Linkable</a></b>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

0