css was not loaded because its MIME type, "text/html", is not "text/css"

Looks like your code is requiring a login to access the CSS stylesheet, and returning a HTML login page instead of the CSS.

To verify, try pasting the URL to the stylesheet into your browser, for instance http://localhost:55381/Styles/Site.css - if you get a login page instead of CSS, that's what you need to fix.


@DavidPrecious gave a great answer that led me to the solution.

In my case, the local computer's Users group needed to be given Read permissions to the c:\Inetpub folder in order to allow the static content to be delivered properly.


Try this:

<location path="~/Styles">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>

Where Styles is the folder that contains style sheet. I solved it this way

Tags:

Stylesheet