473,385 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Style sheet loads locally and on IIS but not in production

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
8 8087
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
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
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
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
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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike | last post by:
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),...
1
by: Jon Paugh | last post by:
Hi, Our ASP.NET app has multiple installations. Each installation is for a different customer. Each customer has their own style sheet and images. Ideally a given installation would not have...
1
by: blue | last post by:
My app draws a bunch of tables on the page and has a form for the user to enter data and submit. The form is contained within a User Control called DecisionCtl. When they submit the form, a bunch...
1
by: Amanda H. | last post by:
I posted about this a few days ago, and I got a few suggestions that fixed part of my problem. I am using a PHP script to switch external style sheets when the viewer clicks on the style link. ...
8
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{...
10
by: pamelafluente | last post by:
Hi, this time I am trying to add a style on the fly.I wish equivalency with this one (only the menuItemStyle line): <head> <style type="text/css" media="screen"> ... some static styles ......
1
by: rbaulbin | last post by:
Hello - Does anyone know if of a utility that can traverse an HTML file for all inline CSS style tag occurrences and generate an external style sheet from them, and then create (intelligent?)...
0
by: _Who | last post by:
A page has style sheet files. Any one might be active at a given time. They all contain the same class names. If on the page I have an iframe that loads a .html file I don't know how to set the...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.