CSS with SSI

CSS with SSI

Posted by: pilot
Posted on: 2008-11-07 14:29:00

To take care of some MSIE/Firefox/Opera differences I use CSS with SSI, that is header section of html document contains the following tag:

<link rel="stylesheet" href="/style.htm" type="text/css">

while style.htm contains the following lines:

< !--#if expr="${HTTP_USER_AGENT} = /Firefox/" -->
< !--#include virtual="/style-ff.css">
< !--#elif expr="${HTTP_USER_AGENT} = /Opera/"-->
< !--#include virtual="/style-op.css">
< !--#else -->
< !--#include virtual="/style-mscss">
< !--#endif -->

(space inserted before "!" to make the tags visible in this forum)

This works fine with my other hosting provider, but not with DreamHost. Why?

Re: CSS with SSI

Posted by: scjessey
Posted on: 2008-11-09 09:31:00

This is a terrible way to feed different CSS to different user agents. First of all, Opera identifies as Internet Explorer by default, yet its CSS support is more similar to that of Firefox and Safari. Instead, I would recommend using conditional comments to feed IE different rules.

-- si-blog --

Tags: ssiopera