Topic: Firefox failing to load CSS via "content_for".

Well, failing to load is not entirely accurate. The CSS loads, but it isn't applied.

Have a Rails (v 2.3.8) site with various sections. There is a master CSS file, and then I also pull in stylesheets specific to certain sections. So, for example, the main template file loads the main CSS file, and then an internal page has;

<% content_for :head do %>
<link rel="stylesheet" type="text/rss" href="/stylesheets/signupandlogin.css">
<% end %>

To load an additional CSS file.

This works fine in Chrome and Safari (haven't reached IE testing stage yet).

In Firefox (v 3.6.8, Mac OSX), none of the styling from the additional CSS file is applied. Checking the rendered source code, the CSS file *is* loaded (it appears fine in the head section of the document), it just isn't applied. It's not a CSS issue itself - as if I copy "signupandlogin.css" and paste it directly at the bottom of the main CSS file, then everything works fine.

Any ideas why this is occurring?

Re: Firefox failing to load CSS via "content_for".

should be:

<link rel="stylesheet" type="text/css" href="/stylesheets/signupandlogin.css">

text/css not text/rss

Last edited by agm_ultimatex (2010-09-02 16:57:32)