Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/08/2010, 05:35
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Usar Javascript para insertar CSS on the Fly

Los punto y coma dentro de comillas no deberían darte ningún problema ya que son tomados cualquier otro caracter dentro de una cadena.
Esto, por ejemplo funciona sin problemas (obviamente, para Explorer necesitarás algún parche para que te tome las esquinas redondeadas, te sugiero http://dillerdesign.com/experiment/DD_roundies/):
Código PHP:
<!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>Documento sin título</title>
<
style type="text/css">
.
algowidth:300pxheight:200pxbackground:#F00; color:#FFF; padding:10px;}
</style>
<
script type="text/javascript">
function 
addCss(cssCode,i) {
    
control=document.getElementById(i)
    if(
control)
        
document.getElementsByTagName("head")[0].removeChild(control)
    var 
styleElement document.createElement("style");
    
styleElement.type "text/css";
    if (
styleElement.styleSheet) {
        
styleElement.styleSheet.cssText cssCode;
    } else {
        
styleElement.appendChild(document.createTextNode(cssCode))
    }
    
styleElement.id =i;
    
document.getElementsByTagName("head")[0].appendChild(styleElement);

onload=function(){
    var 
css ".square {border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;}";
    
addCss(css,'a_'+new Date().getTime());
}
</script>
</head>

<body>
<div class="algo square">Esto es un ejemplo</div>
</body>
</html>