para expertos
tengo un tr que cambia el color de fondo al pasar el raton (ya que tiene un onmouseover). Además el tr es un enlace a un popup (on click open browser window) y además sale la mano en toda la fila pues el tr tiene style :cursor pointer. Ahora quiero que cuando se haya visitado el enlace salga el texto en gris.
Si le pongo un estilo css a esa linea no me lo hace. No quiero darle vlink al body pues este archivo esta basado en una plantilla que tiene su propio estilo. Quiero aplicar otro estilo solo a ese tr. ¿cómo puedo hacerlo? Ahà va el código
ESTE ES EL ESTILO:
<style type="text/css">
<!--
.general a:visited {
color: #cccccc;
text-decoration: none;
}
.general a:link {
color: #000000;
text-decoration: none;
}
.general a:hover {
text-decoration: none;
}
.general a:active {
text-decoration: none;
}
-->
</style>
ESTA ES LA TABLA :
<table width="30%" border="1" cellspacing="0">
<tr class="general" style="cursor:pointer;" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor = '#FF9933'" onmouseout="this.style.backgroundColor = 'white';" >
<td width="32%">dfasfasfa</td>
<td width="32%">dfasfasfa</td>
<td width="32%">dfasfasfa</td>
</tr>
</table>
Si le pongo un estilo css a esa linea no me lo hace. No quiero darle vlink al body pues este archivo esta basado en una plantilla que tiene su propio estilo. Quiero aplicar otro estilo solo a ese tr. ¿cómo puedo hacerlo? Ahà va el código
ESTE ES EL ESTILO:
<style type="text/css">
<!--
.general a:visited {
color: #cccccc;
text-decoration: none;
}
.general a:link {
color: #000000;
text-decoration: none;
}
.general a:hover {
text-decoration: none;
}
.general a:active {
text-decoration: none;
}
-->
</style>
ESTA ES LA TABLA :
<table width="30%" border="1" cellspacing="0">
<tr class="general" style="cursor:pointer;" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor = '#FF9933'" onmouseout="this.style.backgroundColor = 'white';" >
<td width="32%">dfasfasfa</td>
<td width="32%">dfasfasfa</td>
<td width="32%">dfasfasfa</td>
</tr>
</table>
Hay un orden obligatorio para los links :
a:link { color: red } /* unvisited links */
a:visited { color: blue } /* visited links */
a:hover { color: yellow } /* user hovers */
a:active { color: lime } /* active links */
a:link { color: red } /* unvisited links */
a:visited { color: blue } /* visited links */
a:hover { color: yellow } /* user hovers */
a:active { color: lime } /* active links */
si, pero ese orden está ya en el estilo de la plantilla
y yo quiero que a pesar de la plantilla poner mi propio estilo a esta tabla , pero teniendo en cuenta q es un enlace y tiene un on mouse over y un style hand
y yo quiero que a pesar de la plantilla poner mi propio estilo a esta tabla , pero teniendo en cuenta q es un enlace y tiene un on mouse over y un style hand
Cris: probé el código que te puse y a mi si me funcionaba, tanto en Mozilla como en Explorer... De todas formas ten en cuenta que, para que cambie el color de un texto una vez "cliqueado", éste debe ser un enlace... Vuelve a probar el siguiente código:
<html>
<head>
<style type="text/css">
<!--
.general {
cursor:pointer;
}
.general a {
text-decoration: none;
}
.general a:link {
color: #000000;
}
.general a:visited {
color: #999999;
}
.general a:hover {
color: #FFFFFF;
}
.general a:active {
color: #000099;
}
-->
</style>
</head>
<body>
<table width="30%" border="1" cellspacing="0">
<tr class="general" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor='#FF9933'" onmouseout="this.style.backgroundColor='white';">
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
</tr>
</table>
</body>
</html>
No obstante podrÃas probar con algo de JavaScript para cambiar "dinámicamente" los estilos:
<html>
<head>
<style type="text/css">
<!--
.general {
cursor:pointer;
}
.general a {
text-decoration: none;
}
.general a:link {
color: #000000;
}
.general a:hover {
color: #FFFFFF;
}
.general a:active {
color: #000099;
}
.visitado { /*Este es el estilo que se aplica cuando se pulsa sobre los textos de los <td>*/
color: #999999;
}
-->
</style>
</head>
<body>
<table width="30%" border="1" cellspacing="0">
<tr class="general" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor='#FF9933'" onmouseout="this.style.backgroundColor='white';">
<td width="32%" onclick="this.className='visitado';">dfasfasfa</td>
<td width="32%" onclick="this.className='visitado';">dfasfasfa</td>
<td width="32%" onclick="this.className='visitado';">dfasfasfa</td>
</tr>
</table>
</body>
</html>
También está probado y funciona perfectamente. Un saludo.
<html>
<head>
<style type="text/css">
<!--
.general {
cursor:pointer;
}
.general a {
text-decoration: none;
}
.general a:link {
color: #000000;
}
.general a:visited {
color: #999999;
}
.general a:hover {
color: #FFFFFF;
}
.general a:active {
color: #000099;
}
-->
</style>
</head>
<body>
<table width="30%" border="1" cellspacing="0">
<tr class="general" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor='#FF9933'" onmouseout="this.style.backgroundColor='white';">
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
</tr>
</table>
</body>
</html>
No obstante podrÃas probar con algo de JavaScript para cambiar "dinámicamente" los estilos:
<html>
<head>
<style type="text/css">
<!--
.general {
cursor:pointer;
}
.general a {
text-decoration: none;
}
.general a:link {
color: #000000;
}
.general a:hover {
color: #FFFFFF;
}
.general a:active {
color: #000099;
}
.visitado { /*Este es el estilo que se aplica cuando se pulsa sobre los textos de los <td>*/
color: #999999;
}
-->
</style>
</head>
<body>
<table width="30%" border="1" cellspacing="0">
<tr class="general" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor='#FF9933'" onmouseout="this.style.backgroundColor='white';">
<td width="32%" onclick="this.className='visitado';">dfasfasfa</td>
<td width="32%" onclick="this.className='visitado';">dfasfasfa</td>
<td width="32%" onclick="this.className='visitado';">dfasfasfa</td>
</tr>
</table>
</body>
</html>
También está probado y funciona perfectamente. Un saludo.
Pues asà no funciona, al TR no se le pueden aplicar
estilos como los de link, con diferentes clases para
cada situación.
Tendrás que programar algún script que deje el TR con
otro estilo al momento de hacerle click.
estilos como los de link, con diferentes clases para
cada situación.
Tendrás que programar algún script que deje el TR con
otro estilo al momento de hacerle click.
Lo único que se me ocurre es que encierres los textos entre etiquetas <a>. QuedarÃa algo asà como sigue:
<html>
<head>
<style type="text/css">
<!--
.general {
cursor:pointer;
}
.general a:visited {
color: #cccccc;
text-decoration: none;
}
.general a:link {
color: #000000;
text-decoration: none;
}
.general a:visited {
color: #999999;
}
.general a:hover {
text-decoration: none;
}
.general a:active {
text-decoration: none;
}
-->
</style>
</head>
<body>
<table width="30%" border="1" cellspacing="0">
<tr class="general" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor='#FF9933'" onmouseout="this.style.backgroundColor='white';">
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
</tr>
</table>
</body>
</html>
Un saludo.
<html>
<head>
<style type="text/css">
<!--
.general {
cursor:pointer;
}
.general a:visited {
color: #cccccc;
text-decoration: none;
}
.general a:link {
color: #000000;
text-decoration: none;
}
.general a:visited {
color: #999999;
}
.general a:hover {
text-decoration: none;
}
.general a:active {
text-decoration: none;
}
-->
</style>
</head>
<body>
<table width="30%" border="1" cellspacing="0">
<tr class="general" onClick="MM_openBrWindow('logo.jpg','','width=100,height=100')" onmouseover="this.style.backgroundColor='#FF9933'" onmouseout="this.style.backgroundColor='white';">
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
<td width="32%"><a href="">dfasfasfa</a></td>
</tr>
</table>
</body>
</html>
Un saludo.