Pulling in Dynamiclly Generated (not static file) CSS in FF?
Is there a way to pull in a CSS stylesheet in FireFox 2 or 3 that is not a static file?
Below is the code we use to pull out the stylesheet dynamically generated by the CGI script.
<link rel="stylesheet" href="/cgi-bin/Xebra?ShowIt&s=LH4X6I2l4fSYwf4pky4k&shw=795430-0&path=customer/DEMO/demo1.css" type="text/css">
/cgi-bin/Xebra?ShowIt&s=LH4X6I2l4fSYwf4pky4k&shw=795430-0&path=customer/DEMO/demo1.css
Please note that the URL above that pulls in CSS does not end with .css, not parameters.
Is the content type from the server correct for the file being served?
Content-type: text/css
why doesn't it work? Double check that the response header for the cgi script has
Content-Type: text/css
The extension doesn't matter, but you must make sure the content type is "text / css" .
I've done the same thing in the past - the former employer's site uses a link tag similar to yours and works great in FF2 at least (I just tested it, although I tested it in FF when we added this link). If it doesn't work, I would suspect something is in the generated CSS file and not the import page. It looks like the Content-Type consensus from the server might be wrong.
Server processes (e.g. CGI) are run first, right? It seems to me that the link tag will only pull in an already existing file.
So, I would put the server tag (my lang ASP / ASP.Net, but you could use PHP or anything, really) in the href.
Same:
<link rel="stylesheet" type="text/css href="<% =getStylesheetPath() %>" media="all">
Take a picture.