473,386 Members | 1,606 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,386 software developers and data experts.

CSS & Firefox problem

I'm having nightmares with CSS at the moment. Can anyone help me out?

I'm including my stylesheet using the following code

<head>
<title>My Title.</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css"></link>
</head>

In IE this works fine

However, in FireFox it is as if the stylesheet was never loaded at all
(Although checking the server logs shows that firefox successfully
retreived the page)

I'm running IIS6, I've turned off HTTP compression and Ensured that it
is sending the correct MIME type (text/css)

If I copy the contents of stylesheet.css and paste it between
<style></style> tags, then it works fine, and it also works if I save
the .html and .css files to disk and view it locally in FireFox

I'm out of ideas. I could just put the whole stylesheet in
<style></style> tags, but it would be a horrible waste of bandwidth.

Can anyone help?

Jul 21 '05 #1
12 18667
an*********@yahoo.co.uk wrote:
I'm having nightmares
You're taking your job too seriously. <g>
with CSS at the moment. Can anyone help me out?

I'm including my stylesheet using the following code

<head>
<title>My Title.</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css"></link>
</head>


Try removing that redundant </link> at the end.

http://validator.w3.org/

--
-bts
-This space intentionally left blank.
Jul 21 '05 #2
I've tried without the redundant </link> but still have the same
problems.

Jul 21 '05 #3
Just to add some extra details

I've had this problem on another site on the same server. I'm leaning
towards it being a problem with the server. Has anyone got any ideas on
what I can change on the IIS6 server?

Jul 21 '05 #4
an*********@yahoo.co.uk wrote:
I'm including my stylesheet using the following code

<head>
<title>My Title.</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css"></link>
</head>
The </link> is just plain wrong in HTML and is against the
compatability guidelines and best practice in XHTML. Get rid of it.
However, in FireFox it is as if the stylesheet was never loaded at all
(Although checking the server logs shows that firefox successfully
retreived the page)
And you haven't done anything silly like install the Web Developer
toolbar, turn CSS off and forgotten to turn it back on?
I'm running IIS6, I've turned off HTTP compression and Ensured that it
is sending the correct MIME type (text/css)


Well the content-type header would be the first thing to check.
Without a URL we'll have to take your word for it that it's correct.

Is there any HTML inside the CSS file? Any <style> tags? Any HTML
comments <!-- -->? Get rid of any of those.

Beyond that we need a URL so we can see the entire HTML, the entire
CSS and all the HTTP headers.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #5
try

<link rel="stylesheet" type="text/css" media="all" href="stylesheet.css" />

and what doctype are you using?

<an*********@yahoo.co.uk> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
I've tried without the redundant </link> but still have the same
problems.

Jul 21 '05 #6
I've scrapped the </link> (I only put it in there out of desperation
when I couldn't get it working)

I used the header checker at http://www.delorie.com/web/headers.html

And it produces this on a direct access to the .css file:

HTTP/1.1 200 OK
Content-Length: 1270
Content-Type: text/css
Last-Modified: Fri, 18 Feb 2005 12:41:33 GMT
Accept-Ranges: bytes
ETag: "25116e2db715c51:e37"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Fri, 18 Feb 2005 14:48:33 GMT
Connection: close

The CSS works fine (even in Mozilla) with existing pages.

I've checked the HTML, it's 'almost' valid HTML4.01. (It throws up a
couple of errors where a background attribute is used in a table but
apart from that it is valid, I'll use CSS for backgrounds once I get
CSS working)

Jul 21 '05 #7
>and what doctype are you using?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

I've also tried it without a doctype at all, with no change in results

Jul 21 '05 #8
an*********@yahoo.co.uk wrote:

Please quote some of the post you're replying to. Messages propagate
at different rates and people may see your reply before mine. It also
helps to know which parts of my post you're replying to and which
you're ignoring.
The CSS works fine (even in Mozilla) with existing pages.


Do those pages use the same doctype as the problematic ones? If the
new ones trigger Standards mode and the old ones trigger Quirks mode
then Mozilla can reject CSS that was previously accepted.

Post the URL or give up.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #9
> Please quote some of the post you're replying to. Messages propagate
at different rates and people may see your reply before mine.
Sorry, I'm using Google Groups rather than my usual newsreader as I'm
at a client site and wasn't used to the new interface they have.

I have it sussed now though :-)
The CSS works fine (even in Mozilla) with existing pages.


Do those pages use the same doctype as the problematic ones?


The old pages don't have a doctype at all.
Post the URL or give up.


OK, it's an adult site so probably not worksafe...

http://ukescorts.brightlamp.com/topfemales1.html

To see the original page, go to:

http://www.ukescorts.com/search_form.asp

Don't change anything on the dropdown and click on search to get the
page.

Jul 21 '05 #10
an*********@yahoo.co.uk wrote:
>The CSS works fine (even in Mozilla) with existing pages.
Do those pages use the same doctype as the problematic ones?


The old pages don't have a doctype at all.


So they definitely trigger quirks mode. The new one triggers Standards
mode.
Post the URL or give up.


OK, it's an adult site so probably not worksafe...


Work from home, so more worried about it being girlfriend-safe...
http://ukescorts.brightlamp.com/topfemales1.html


Hmm, Firefox is definitely fetching the CSS but not using it. There
are some errors in your CSS:
http://jigsaw.w3.org/css-validator/v...1&profile=css2
but nothing that should cause the whole stylesheet to be ignored.

I get the same problem even when I download the files and view the
local copy so it doesn't seem to be a server problem. Taking the
doctype out and thus forcing quirks mode doesn't help either.

Ah, it's in UTF-16. I'd try changing to a different encoding, UTF-16
can cause some unusual things to happen. For a UK-centric page written
entirely in English there's no good reason to use UTF-16.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #11

Steve Pugh wrote:
Ah, it's in UTF-16. I'd try changing to a different encoding, UTF-16
can cause some unusual things to happen. For a UK-centric page written entirely in English there's no good reason to use UTF-16.


Bingo!

I added the following line:

<META http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">

And as if by magic, the styles appeared :-)

Thank-you very much indeed for your help. I'd never in a million years
thought about changing the encoding.

Does anyone know how I can change the default character set for .html
files served by IIS6 without resorting to http-equiv tags?

Jul 21 '05 #12
> I added the following line:

<META http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">

And as if by magic, the styles appeared :-)


Actually, no, that's not what fixed it.

I finally got to the root of the problem. The application I wrote to
generate the .html files was saving the files in Unicode format, hence
breaking it.

When I tried locally, what I actually did was view the source on the
web page and saving it locally using my text editor (saving it in ASCII
and therefore fixing it)

When I added the meta-equiv tag, I edited the generated .html file with
a text editor rather than re-running the .html generating app, so it
got saved in ASCII again.

I'm suprised it didn't dawn on me that the two sites I was having css
problems with were the two sites using this .html generating script.

I'm quite relieved to have this sorted now :-)

Thanks again for your help.

Jul 21 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
13
by: rbronson1976 | last post by:
Hi all, I have a very simple page that Firefox has problems with: www.absolutejava.com/testing.htm First of all, this page seems to be perfectly valid XHTML Strict. Both the W3C validator as...
4
by: L2XL | last post by:
I have an ASP.NET (VB) app that I created for the Windows and IE6 enviroment. When it runs under Firefox on Windows it looks similar but has some display issues. When I run it under Firefox on...
12
by: PMA | last post by:
Hi all, I am porting a web application from IE 6.0 to FireFox 1.5. I have solved almost all compatibility issues (quite a lot but not too bad) except two of them : 1) Clipboard access thru'...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
3
by: Nathan Sokalski | last post by:
I am adding an onmouseover attribute using the Attributes.Add() method, and the String I am using for the value contains the & character. However, when rendered the & is converted to the HTML...
24
by: Swifty | last post by:
People insist on examples, so here is my page: http://swiftys.org.uk/therules.html A colleague in China is viewing the page using IE6 any my &ldquo; characters are coming out as pair of Chinese...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.