views:

2003

answers:

8

I have a rails application that I am running with Vista,IIS7 and SQL 2005. For some reason the CSS is not being rendered. The CSS works fine when I use Webrick.

Any ideas how to get CSS working correctly with IIS7. I have uninstalled and reinstalled windows components "Common Http Features" with no luck.

A: 

Does it render in other browsers? If, for example, you can't see it in Firefox, either, it may be something as simple as a non-parseable link src parameter.

John Dunagan
It does not work in IE8, FireFox or Chrome when using IIS7. It works in all browsers using webrick.
FortunateDuke
+3  A: 

Can you use Firebug or something to check that IIS7 is sending the correct MIME type with your stylesheets? Some browsers will ignore CSS unless the server explicitly sends

Content-Type: text/css

in the HTTP response headers, and with dynamic content or non-standard file extensions you may find that IIS7 isn't configured to do this "out of the box"

Dylan Beattie
+1  A: 

What is the mime-type in the CSS file's header being sent from the server? It needs to be text/css.

eyelidlessness
A: 

Is your CSS file a linked resource? If not, and it's inline, I find it incredibly strange that your CSS is not rendering - as CSS is only processed by the web browser.

If, as is likely, the CSS is a linked resource then it's a safe bet that is not finding the CSS file - perhaps your web root is configured incorrectly, or maybe your css file is generated and the file header response isn't correct.

Try changing the link, if it's relative make it absolute, otherwise do the reverse. Use something like Firebug or HTTP Fiddler to see if the file is found or not.

BrynJ
+1  A: 

I would install and run Fiddler2 in IE and see what is comming across on the HTTP Requests.

If the "CSS" isn't working, it is almost guaranteeing that the file isn't linked correctly, or is serving up the wrong content-type headers.

scunliffe
A: 

One issue I've run into before was giving each css link tag a 'title' attribute to describe them: some browsers will consider that to mean each css file is meant to be viewed independently of the others (like themes)

If that's the case, remove the title attribute

John
A: 

Cascading Style Sheets (CSS) web design lessons Css link Properties Attributes - examles

http://css-lessons.ucoz.com/link-css-examples-1.htm http://css-lessons.ucoz.com/link-css-examples-2.htm

+2  A: 

My Solution was here

You need to add some additional features to IIS from programs and features

mehmet altıparmak