A voir également:
- Urgent comment change couleur d'autre cellule
- Excel cellule couleur si condition texte - Guide
- Somme si couleur - Guide
- Comment aller à la ligne dans une cellule excel - Guide
- Verrouiller cellule excel - Guide
- Changer la couleur de la barre des taches - Guide
2 réponses
lolo1901
Messages postés
7
Date d'inscription
vendredi 14 janvier 2011
Statut
Membre
Dernière intervention
5 février 2011
1
4 févr. 2011 à 16:23
4 févr. 2011 à 16:23
pour changer le fond de la cellule que tu survole, utilise l'id de la cellule :
#btn_menu_1:hover{
background-color:yellow;
}
si tu veux changer le fond d'une autre cellule, utilise le javascript avec l'event onMouseOver sur la cellule que tu survole et après tu change le fond de l'autre cellule avec document.getElementById('cellule1').style = "background-color:yellow";
#btn_menu_1:hover{
background-color:yellow;
}
si tu veux changer le fond d'une autre cellule, utilise le javascript avec l'event onMouseOver sur la cellule que tu survole et après tu change le fond de l'autre cellule avec document.getElementById('cellule1').style = "background-color:yellow";
Salut! essaye ca!
<table border='1' align='center' cellpadding='0' cellspacing='0' height='38' class='btn_menu'>
<tr>
<td onmouseover="this.style.background='#ffff00'" onmouseout="this.style.background=''" width='10'> celule1</td>
<td onmouseover="this.style.background='#0000ff'" onmouseout="this.style.background=''" align='center' ><a id='contact_hor' href='contact.php'> Contact</a></td>
<td onmouseover="this.style.background='#ff0000'" onmouseout="this.style.background='green'" width='9' >celule3 </td>
</tr>
</table>
ou
<table border='1' align='center' cellpadding='0' cellspacing='0' height='38' class='btn_menu'>
<tr>
<td onmouseover="this.className='CelOver1'" onmouseout="this.className='CelOut1'" width='10'> celule1</td>
<td onmouseover="this.className='CelOver2'" onmouseout="this.className='CelOut2'" align='center' ><a id='contact_hor' href='contact.php'> Contact</a></td>
<td onmouseover="this.className='CelOver3'" onmouseout="this.className='CelOut3'" width='9' >celule3 </td>
</tr>
</table>
<style>
.CelOver1 { background:#ffff00}
.CelOout1 { background:}
.CelOver2 { background:#ff0000}
.CelOout2 { background:}
.CelOver3 { background:#ff0000}
.CelOout3 { background:green}
</style>
<table border='1' align='center' cellpadding='0' cellspacing='0' height='38' class='btn_menu'>
<tr>
<td onmouseover="this.style.background='#ffff00'" onmouseout="this.style.background=''" width='10'> celule1</td>
<td onmouseover="this.style.background='#0000ff'" onmouseout="this.style.background=''" align='center' ><a id='contact_hor' href='contact.php'> Contact</a></td>
<td onmouseover="this.style.background='#ff0000'" onmouseout="this.style.background='green'" width='9' >celule3 </td>
</tr>
</table>
ou
<table border='1' align='center' cellpadding='0' cellspacing='0' height='38' class='btn_menu'>
<tr>
<td onmouseover="this.className='CelOver1'" onmouseout="this.className='CelOut1'" width='10'> celule1</td>
<td onmouseover="this.className='CelOver2'" onmouseout="this.className='CelOut2'" align='center' ><a id='contact_hor' href='contact.php'> Contact</a></td>
<td onmouseover="this.className='CelOver3'" onmouseout="this.className='CelOut3'" width='9' >celule3 </td>
</tr>
</table>
<style>
.CelOver1 { background:#ffff00}
.CelOout1 { background:}
.CelOver2 { background:#ff0000}
.CelOout2 { background:}
.CelOver3 { background:#ff0000}
.CelOout3 { background:green}
</style>
6 févr. 2011 à 15:18