CSS & Firefox problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • annoyedtuna@yahoo.co.uk

    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="styleshee t.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?

  • Beauregard T. Shagnasty

    #2
    Re: CSS &amp; Firefox problem

    annoyedtuna@yah oo.co.uk wrote:[color=blue]
    > I'm having nightmares[/color]

    You're taking your job too seriously. <g>
    [color=blue]
    > 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="styleshee t.css" type="text/css"></link>
    > </head>[/color]

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

    W3C's easy-to-use markup validation service, based on SGML and XML parsers.


    --
    -bts
    -This space intentionally left blank.

    Comment

    • annoyedtuna@yahoo.co.uk

      #3
      Re: CSS &amp; Firefox problem

      I've tried without the redundant </link> but still have the same
      problems.

      Comment

      • annoyedtuna@yahoo.co.uk

        #4
        Re: CSS &amp; Firefox problem

        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?

        Comment

        • Steve Pugh

          #5
          Re: CSS &amp; Firefox problem

          annoyedtuna@yah oo.co.uk wrote:
          [color=blue]
          >I'm including my stylesheet using the following code
          >
          ><head>
          ><title>My Title.</title>
          ><link rel="stylesheet " href="styleshee t.css" type="text/css"></link>
          ></head>[/color]

          The </link> is just plain wrong in HTML and is against the
          compatability guidelines and best practice in XHTML. Get rid of it.
          [color=blue]
          >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)[/color]

          And you haven't done anything silly like install the Web Developer
          toolbar, turn CSS off and forgotten to turn it back on?
          [color=blue]
          >I'm running IIS6, I've turned off HTTP compression and Ensured that it
          >is sending the correct MIME type (text/css)[/color]

          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 <steve@pugh.net > <http://steve.pugh.net/>

          Comment

          • Blacksmith

            #6
            Re: CSS &amp; Firefox problem

            try

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

            and what doctype are you using?

            <annoyedtuna@ya hoo.co.uk> wrote in message
            news:1108737167 .408972.129760@ c13g2000cwb.goo glegroups.com.. .[color=blue]
            > I've tried without the redundant </link> but still have the same
            > problems.
            >[/color]


            Comment

            • annoyedtuna@yahoo.co.uk

              #7
              Re: CSS &amp; Firefox problem

              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: "25116e2db715c5 1: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)

              Comment

              • annoyedtuna@yahoo.co.uk

                #8
                Re: CSS &amp; Firefox problem

                >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

                Comment

                • Steve Pugh

                  #9
                  Re: CSS &amp; Firefox problem

                  annoyedtuna@yah oo.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.
                  [color=blue]
                  >The CSS works fine (even in Mozilla) with existing pages.[/color]

                  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 <steve@pugh.net > <http://steve.pugh.net/>

                  Comment

                  • annoyedtuna@yahoo.co.uk

                    #10
                    Re: CSS &amp; Firefox problem

                    > Please quote some of the post you're replying to. Messages propagate[color=blue]
                    > at different rates and people may see your reply before mine.[/color]

                    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 :-)
                    [color=blue][color=green]
                    > >The CSS works fine (even in Mozilla) with existing pages.[/color]
                    >
                    > Do those pages use the same doctype as the problematic ones?[/color]

                    The old pages don't have a doctype at all.
                    [color=blue]
                    > Post the URL or give up.[/color]

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



                    To see the original page, go to:



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

                    Comment

                    • Steve Pugh

                      #11
                      Re: CSS &amp; Firefox problem

                      annoyedtuna@yah oo.co.uk wrote:
                      [color=blue][color=green][color=darkred]
                      >> >The CSS works fine (even in Mozilla) with existing pages.[/color]
                      >>
                      >> Do those pages use the same doctype as the problematic ones?[/color]
                      >
                      >The old pages don't have a doctype at all.[/color]

                      So they definitely trigger quirks mode. The new one triggers Standards
                      mode.
                      [color=blue][color=green]
                      >> Post the URL or give up.[/color]
                      >
                      >OK, it's an adult site so probably not worksafe...[/color]

                      Work from home, so more worried about it being girlfriend-safe...
                      [color=blue]
                      >http://ukescorts.brightlamp.com/topfemales1.html[/color]

                      Hmm, Firefox is definitely fetching the CSS but not using it. There
                      are some errors in your CSS:

                      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 <steve@pugh.net > <http://steve.pugh.net/>

                      Comment

                      • annoyedtuna@yahoo.co.uk

                        #12
                        Re: CSS &amp; Firefox problem


                        Steve Pugh wrote:
                        [color=blue]
                        > 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[/color]
                        written[color=blue]
                        > entirely in English there's no good reason to use UTF-16.[/color]

                        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?

                        Comment

                        • annoyedtuna@yahoo.co.uk

                          #13
                          Re: CSS &amp; Firefox problem

                          > I added the following line:[color=blue]
                          >
                          > <META http-equiv="Content-Type" content="text/html;
                          > charset=ISO-8859-1">
                          >
                          > And as if by magic, the styles appeared :-)[/color]

                          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.

                          Comment

                          Working...