By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,901 Members | 1,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,901 IT Pros & Developers. It's quick & easy.

Style sheet loads locally and on IIS but not in production

P: n/a
I have a page with the following code (just the essentials...)
Anyway, the style sheet loads and formats perfectly locally on all my
test browsers (IE 6, NS 7.1, K-Meleon, Phoenix/Mozilla, Opera), but
when I upload it to production and view it on my server the style
sheets apparently do not load in any browser but IE. I know IE tends
to be more forgiving, but I cannot for the life of me figure out what
is breaking. Any help is more than welcome.

Thanks,

Mike

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
<title>Farmer Cooperatives 2003</title>

<style type="text/css" media="all">@import url(fc03.css);</style>
</head>
Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Mike <ms********@charter.net> wrote:
Anyway, the style sheet loads and formats perfectly locally on all my
test browsers (IE 6, NS 7.1, K-Meleon, Phoenix/Mozilla, Opera), but
when I upload it to production and view it on my server the style
sheets apparently do not load in any browser but IE. I know IE tends
to be more forgiving, but I cannot for the life of me figure out what
is breaking. Any help is more than welcome.


My guess is that the server is sending the wrong MIME type (e.g.,
text/plain or application/octet-stream) and that better browsers are
therefore ignoring it.

But without the URL of a sample document, all I can do is guess.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"You can't strengthen the weak by weakening the strong."
Jul 20 '05 #2

P: n/a
Mike wrote:

[snip]
when I upload it to production and view it on my server the style
sheets apparently do not load in any browser but IE. I know IE tends
to be more forgiving, but I cannot for the life of me figure out what
is breaking. Any help is more than welcome.


Chances are, your production server is misconfigured. You need to send CSS
files using the text/css MIME-type, talk to your server admin/read your
manual to find out how to do this. If you had included a URL, people would
have been able to tell you conclusively.
--
Jim Dabell

Jul 20 '05 #3

P: n/a
Jim Dabell <ji********@jimdabell.com> wrote in message news:<HG********************@giganews.com>...
Mike wrote:

[snip]
when I upload it to production and view it on my server the style
sheets apparently do not load in any browser but IE. I know IE tends
to be more forgiving, but I cannot for the life of me figure out what
is breaking. Any help is more than welcome.


Chances are, your production server is misconfigured. You need to send CSS
files using the text/css MIME-type, talk to your server admin/read your
manual to find out how to do this. If you had included a URL, people would
have been able to tell you conclusively.


Jim and Darin,

I have it on a test server
(http://www.wisc.edu:2784/uwcc/farmercoops03/index.html, but I will
copy the entire site into production that is available from outside
our backbone network. I hesitated because the person for whom the
page/site was requested does not want it publicly available yet. I
will copy it into production anyway and it can be viewed at
http://www.wisc.edu/uwcc/farmercoops03/index.html Sorry for the
inconvenience of having to debug without the actual URL and thank you
for sharing your expertise.

Mike
Jul 20 '05 #4

P: n/a
Mike wrote:
I
will copy it into production anyway and it can be viewed at
http://www.wisc.edu/uwcc/farmercoops03/index.html Sorry for the
inconvenience of having to debug without the actual URL and thank you
for sharing your expertise.


<http://www.wisc.edu/uwcc/farmercoops03/fc03.css> is sent as text/plain,
must be text/css.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #5

P: n/a
Johannes Koch <ko**@w3development.de> wrote in message news:<bh*************@ID-61067.news.uni-berlin.de>...
Mike wrote:
I
will copy it into production anyway and it can be viewed at
http://www.wisc.edu/uwcc/farmercoops03/index.html Sorry for the
inconvenience of having to debug without the actual URL and thank you
for sharing your expertise.


<http://www.wisc.edu/uwcc/farmercoops03/fc03.css> is sent as text/plain,
must be text/css.

Johannes,

I have contacted my site administrators and asked them to look into
this potential mis-configuration and correct it if it is indeed
mis-configured. I would very much appreciated a brief tutorial on how
you diagnosed this problem.

Best,

Mike
Jul 20 '05 #6

P: n/a
"Mike" <ms********@charter.net> wrote in message
news:53*************************@posting.google.co m...
Johannes Koch <ko**@w3development.de> wrote in message news:<bh*************@ID-61067.news.uni-berlin.de>...
Mike wrote:
I
will copy it into production anyway and it can be viewed at
http://www.wisc.edu/uwcc/farmercoops03/index.html Sorry for the
inconvenience of having to debug without the actual URL and thank you
for sharing your expertise.


<http://www.wisc.edu/uwcc/farmercoops03/fc03.css> is sent as text/plain,
must be text/css.

..... I have contacted my site administrators and asked them to look into
this potential mis-configuration and correct it if it is indeed
mis-configured. I would very much appreciated a brief tutorial on how
you diagnosed this problem.


If you are hosting the final page off the same site,
which runs Apache, you might having a look at this..
http://httpd.apache.org/docs-2.0/mod/mod_include.html

HTH

--
Andrew Thompson
http://www.lensescapes.com/
http://www.physci.org/
http://www.1point1c.org/
Jul 20 '05 #7

P: n/a
Mike wrote:
Johannes Koch <ko**@w3development.de> wrote in message
news:<bh*************@ID-61067.news.uni-berlin.de>...

[snip]
<http://www.wisc.edu/uwcc/farmercoops03/fc03.css> is sent as text/plain,
must be text/css.

Johannes,

I have contacted my site administrators and asked them to look into
this potential mis-configuration and correct it if it is indeed
mis-configured. I would very much appreciated a brief tutorial on how
you diagnosed this problem.


The problem occurs at the HTTP level. When a web server responds to a
browser request, it includes a few headers that include information about
the resource, the state of the server, and so on. One of these headers is
Content-Type. This header tells the browser (the client) what type of
resource is being sent back - unlike in some environments, file extensions
are irrelevant to HTTP.

In your case, you want your server to say that your stylesheets are of type
text/css. This media type is defined by RFC 2318 [1]. However, your
server is actually claiming that your stylesheets are of the media type
text/plain.

Unfortunately, Internet Explorer ignores a mandatory requirement of the HTTP
specification [2], and so you see effects like the one you describe - where
it ignores what the server is telling it.

You can diagnose this problem by examining the HTTP headers. A handy way of
doing this is to install the Live HTTP Headers extension [3] to Mozilla /
Phoenix / Netscape, and right-click on the page, selecting "View Page
Info", and the Headers tab. You want to look at the Response headers, in
particular, the Content-Type header. Remember, it tells you the
content-type of the resource you are looking at - so you'll have to visit
the stylesheet URL, not the HTML URL.

PS: There's no need to upload a whole site when trying to track down a
problem. Narrowing it down to the simplest possible test case often leads
you straight to the problem, and when it doesn't, there's no problem in
publishing it for others to see.
[1] <URL:http://www.ietf.org/rfc/rfc2318.txt>
[2] <URL:http://www.ietf.org/rfc/rfc2616.txt>
[3] <URL:http://livehttpheaders.mozdev.org/>

--
Jim Dabell

Jul 20 '05 #8

P: n/a
Jim Dabell <ji********@jimdabell.com> wrote in message news:<2-********************@giganews.com>...
Mike wrote:
Johannes Koch <ko**@w3development.de> wrote in message
news:<bh*************@ID-61067.news.uni-berlin.de>...

[snip]
<http://www.wisc.edu/uwcc/farmercoops03/fc03.css> is sent as text/plain,
must be text/css.

Johannes,

I have contacted my site administrators and asked them to look into
this potential mis-configuration and correct it if it is indeed
mis-configured. I would very much appreciated a brief tutorial on how
you diagnosed this problem.


The problem occurs at the HTTP level. When a web server responds to a
browser request, it includes a few headers that include information about
the resource, the state of the server, and so on. One of these headers is
Content-Type. This header tells the browser (the client) what type of
resource is being sent back - unlike in some environments, file extensions
are irrelevant to HTTP.

In your case, you want your server to say that your stylesheets are of type
text/css. This media type is defined by RFC 2318 [1]. However, your
server is actually claiming that your stylesheets are of the media type
text/plain.

Unfortunately, Internet Explorer ignores a mandatory requirement of the HTTP
specification [2], and so you see effects like the one you describe - where
it ignores what the server is telling it.

You can diagnose this problem by examining the HTTP headers. A handy way of
doing this is to install the Live HTTP Headers extension [3] to Mozilla /
Phoenix / Netscape, and right-click on the page, selecting "View Page
Info", and the Headers tab. You want to look at the Response headers, in
particular, the Content-Type header. Remember, it tells you the
content-type of the resource you are looking at - so you'll have to visit
the stylesheet URL, not the HTML URL.

PS: There's no need to upload a whole site when trying to track down a
problem. Narrowing it down to the simplest possible test case often leads
you straight to the problem, and when it doesn't, there's no problem in
publishing it for others to see.
[1] <URL:http://www.ietf.org/rfc/rfc2318.txt>
[2] <URL:http://www.ietf.org/rfc/rfc2616.txt>
[3] <URL:http://livehttpheaders.mozdev.org/>


Jim,

Thank you for your illuminating posting. I can go to bed tonight
happy that I have learned something.

I installed the extension and looked at the Headers tab as indicated.
Of course, it is text/plain as you noted. I am just waiting to hear
back from my site admins to see what they have to say. Great
information. I'll be sure to post further CSS questions as they
arise.

Thanks to all who helped out.

Mike
Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.