Ver Mensaje Individual
  #6 (permalink)  
Antiguo 02/05/2008, 12:23
PeGaSuSeAc
 
Fecha de Ingreso: mayo-2005
Mensajes: 31
Antigüedad: 19 años
Puntos: 0
Re: codigop css de un enlace en el mismo enlace

ya logre hacerlo dinamicamente en asp, posteo abajo lo que hice y funcionó.

Lo que quiero preguntar es lo siguiente: (no es acerca de programacion)

Si o si hay que colocar los estilos en el head de la pagina ?

lo he probado de las dos formas, colocando dentro del head y fuera (body) y me anda perfecto, tanto en el firefox como en en ie.

aca va el codigo que hice en asp, es facil de entender:

Código HTML:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>links</title>

<%
'defino la variable color
dim color
color = "Background"
%>

<style type="text/css">
.link1 A:link {
	FONT-WEIGHT: bold;
	FONT-SIZE: 11px;

        /*coloco la variable en el estilo*/

	COLOR: <%=color%> ;

	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	TEXT-DECORATION: none;
}
.link1 A:active {
	text-decoration: none;
}
.link1 A:visited {
	FONT-WEIGHT: bold; 
	FONT-SIZE: 11px; 
	COLOR: #FE330A; 
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; 
	TEXT-DECORATION: none;
}
.link1 A:hover {
	FONT-WEIGHT: bold;
	FONT-SIZE: 11px;
	COLOR: Teal;
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	TEXT-DECORATION: underline;
}
</style>
</head>

<body>
<p  class='link1'><a href="links222.html">este es el link</a></p>
</body>
</html>


lo probe y anda de 10, ahora poniendo en el body tambien anda:

Código HTML:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>links</title>
</head>
<body>

<%
dim color
color = "Background"
%>

<style type="text/css">
.link1 A:link {
	FONT-WEIGHT: bold;
	FONT-SIZE: 11px;

        /*coloco la variable en el estilo*/

	COLOR:<%=color%>;

	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	TEXT-DECORATION: none;
}
.link1 A:active {
	/*background: transparent;*/
	text-decoration: none;
}
.link1 A:visited {
	FONT-WEIGHT: bold; 
	FONT-SIZE: 11px; 
	COLOR: #FE330A; 
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; 
	TEXT-DECORATION: none;
}
.link1 A:hover {
	FONT-WEIGHT: bold;
	FONT-SIZE: 11px;
	COLOR: Teal;
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	TEXT-DECORATION: underline;
}
</style>

<p  class='link1'><a href="links222.html">este es el link</a></p>
</body>
</html> 
Estoy colocando los datos de las propiedades en una bd.