Previous Message
Next Message

Firefox/IE not recognizing stylesheet

Sent by L. David Baron on 28 March 2006 05:05

Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB"
Content-Disposition: inline

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Monday 2006-03-27 23:15 -0500, Roger Roelofs wrote:
> On Mar 27, 2006, at 9:46 PM, Kim wrote:
> > This seems like it must be so obvious, but I've looked at the <head>
> > about a million times and can't see what's happening.
> >
> > Basically, I have a test page that is using a stylesheet. Only Safari
> > recognizes the stylesheet and displays. For some some reason Firefox
> > and IE don't see it. I'm assuming something in the head or doctype of
> > my page is wrong, but I can't seem to figure it out. Help! :)
> >
> >
> Save as: options: encoding: utf-8 no bom (and change the meta=20
> http-equiv=3D"content-type..." to match.  The BOM is a 'byte order mark'=
> and is required for utf-16 so the reader knows how to read the two-byte=
> characters in the file.  it is fairly uncommon on web pages as you=20
> discovered.

It's not really that it's uncommon on Web pages; I think UTF-16 is used
sometimes for East Asian languages, and generally with a BOM.

The issue is that the stylesheet is not in the same encoding, and the
browser's first guess at the encoding of the stylesheet is to use the
encoding of the document.  (This is actually contrary to the spec, but
all browsers have to do it because all the others do, or we break a lot
of Japanese (?) sites.)  If the style sheet began with: @charset
"UTF-8"; (or other appropriate single-byte encoding), it would probably
help.  (When I say begin, I mean it has to be the first characters in
the style sheet, with no comments or white space preceding.)

Also, "utf-16be-with-bom" is not a recognized encoding name; the
official list ( contains
UTF-16BE.  Whether or not it has a BOM isn't part of the name.

That said, the advice "always use UTF-8" is sound advice, and probably
the best fix for this problem.  There's no reason for a Web page in
English to be using two bytes per character.  And it's also good to
always say what encoding you're using:


L. David Baron                                <URL: >
           Technical Lead, Layout & CSS, Mozilla Corporation

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.2.2 (GNU/Linux)



Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: