ie7 tiene CSS dedicado pero también carga el no dedicado

hope sombody can enlighten me here,

i am writing a joomla template. ie7 has a seperate css using:

<!--[if IE 7]>
<link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/css/template_ie7.css" type="text/css" />  

but is also loads the non ie7 css and accepts its styles, so nothing get fixed....

does anybody know what to do?

thanks, Jonatahn

preguntado el 01 de febrero de 12 a las 22:02

1 Respuestas

Using conditional css loading this way is not (at least for me) the best way to handle this situation.

As you are writing a template you can acces to the $_SERVER['HTTP_USER_AGENT'] variable in order to determine if the iExplorer (or any other) css is needed and then use php to filter it's load

if(stripos ( $_SERVER['HTTP_USER_AGENT'], "MSIE 7.0") > 0 ){
    /* LOAD IE7 CSS here */
    /* LOAD normal CSS here */

This way you can load the IE7 css ONLY.

Respondido 02 Feb 12, 06:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.