Firefox not applying style...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guillaume Dargaud

    Firefox not applying style...

    Hello all,
    I have a strange problem with a new install of Gallery2: Firefox does not
    display the style of the pages while IE does (but nobody I know uses IE).

    I'm not familiar with the way Gallery2 generates its pages but my config
    uses Apache (on Windows), php5, MySQL, etc... There are several themes
    available in Gallery2 but none display in FF. It's like the CSS is ignored.

    The pages I get in the browser contain the following CSS links:
    [...]
    <link rel="stylesheet " type="text/css"
    href="main.php? g2_view=imagefr ame.CSS&amp;g2_ frames=none%7Cp olaroids"/>
    <link rel="stylesheet " type="text/css"
    href="modules/core/data/gallery.css"/>
    <link rel="stylesheet " type="text/css"
    href="modules/icons/iconpacks/silk/icons.css"/>
    <link rel="stylesheet " type="text/css" href="themes/matrix/theme.css"/>
    [...]

    I tried on 4 different machines with different add-ons and Firefox never
    displays the style for none of the themes. On one machine I have the 'web
    developer' add-on so I started experimenting. First, as a verification, if I
    disable css, nothing changes. Then something strange: if I go in the CSS
    editor, then suddenly FF displays the page properly ! If I exit, it reverts
    to a no-CSS display. Then while in the CSS editor, if I disable embedded
    styles, all styles disappear. Does that give anyone a hint as to what's
    going on ?!?

    PS: anyone can recommand a forum for FF-specific questions of this type ?
    Thanks.
    --
    Guillaume Dargaud
    Climbing adventures, deep cold Antarctica tales and pictures, penguins, royalty-free photography, geek code and humor, plenty of quotes...



  • Harlan Messinger

    #2
    Re: Firefox not applying style...

    Guillaume Dargaud wrote:
    PS: anyone can recommand a forum for FF-specific questions of this type ?
    Thanks.

    Comment

    • Bergamot

      #3
      Re: Firefox not applying style...

      Guillaume Dargaud wrote:
      >
      I have a strange problem with a new install of Gallery2: Firefox does not
      display the style of the pages while IE does (but nobody I know uses IE).
      >
      <link rel="stylesheet " type="text/css"
      href="main.php? g2_view=imagefr ame.CSS&amp;g2_ frames=none%7Cp olaroids"/>
      Make sure the php script is sending the right content type in the
      header. Firefox may ignore the stylesheet if the MIME type isn't text/css.

      --
      Berg

      Comment

      • C A Upsdell

        #4
        Re: Firefox not applying style...

        Guillaume Dargaud wrote:
        Hello all,
        I have a strange problem with a new install of Gallery2: Firefox does not
        display the style of the pages while IE does (but nobody I know uses IE).
        >
        I'm not familiar with the way Gallery2 generates its pages but my config
        uses Apache (on Windows), php5, MySQL, etc... There are several themes
        available in Gallery2 but none display in FF. It's like the CSS is ignored.
        >
        The pages I get in the browser contain the following CSS links:
        [...]
        <link rel="stylesheet " type="text/css"
        href="main.php? g2_view=imagefr ame.CSS&amp;g2_ frames=none%7Cp olaroids"/>
        <link rel="stylesheet " type="text/css"
        href="modules/core/data/gallery.css"/>
        <link rel="stylesheet " type="text/css"
        href="modules/icons/iconpacks/silk/icons.css"/>
        <link rel="stylesheet " type="text/css" href="themes/matrix/theme.css"/>
        [...]
        Some of the above, I think, is invalid XHTML. E.g. there should be a
        space before each '/>'.


        Comment

        • Guillaume Dargaud

          #5
          Re: Firefox not applying style...

          Make sure the php script is sending the right content type in the
          header. Firefox may ignore the stylesheet if the MIME type isn't text/css.
          Apparently that's the hitch. It sends text/html on css files. I've verified
          mime.conf and added " AddType text/css css .css" in httpd.conf but still no
          go.
          The only way I can make it work is to set default_mimetyp e = "" in php.ini

          Doesn't sound normal to me...
          --
          Guillaume Dargaud
          Climbing adventures, deep cold Antarctica tales and pictures, penguins, royalty-free photography, geek code and humor, plenty of quotes...





          Comment

          • Jonathan N. Little

            #6
            Re: Firefox not applying style...

            Guillaume Dargaud wrote:
            >Make sure the php script is sending the right content type in the
            >header. Firefox may ignore the stylesheet if the MIME type isn't text/css.
            >
            Apparently that's the hitch. It sends text/html on css files. I've verified
            mime.conf and added " AddType text/css css .css" in httpd.conf but still no
            go.
            The only way I can make it work is to set default_mimetyp e = "" in php.ini
            >
            Doesn't sound normal to me...
            Then it your php script.

            <?php
            // Try setting the header.
            header('Content-Type: text/css');
            echo $theCss;
            ?>

            --
            Take care,

            Jonathan
            -------------------
            LITTLE WORKS STUDIO

            Comment

            • Bergamot

              #7
              Re: Firefox not applying style...

              Guillaume Dargaud wrote:
              >Make sure the php script is sending the right content type in the
              >header. Firefox may ignore the stylesheet if the MIME type isn't text/css.
              >
              Apparently that's the hitch. It sends text/html on css files. I've verified
              mime.conf and added " AddType text/css css .css" in httpd.conf but still no
              go.
              That's because you're stylesheet links to a .php file, not .css.

              Do as Mr Little suggested - put the header in the php script.

              --
              Berg

              Comment

              • Guillaume Dargaud

                #8
                Re: Firefox not applying style...

                Do as Mr Little suggested - put the header in the php script.

                Which is easy if I'm the one writing the php (and I do when I do...), but I
                get Gallery2 off svn and don't really want to mess with their otherwise
                excellent code...
                --
                Guillaume Dargaud
                Climbing adventures, deep cold Antarctica tales and pictures, penguins, royalty-free photography, geek code and humor, plenty of quotes...



                Comment

                • Jonathan N. Little

                  #9
                  Re: Firefox not applying style...

                  Guillaume Dargaud wrote:
                  >Do as Mr Little suggested - put the header in the php script.
                  >
                  Which is easy if I'm the one writing the php (and I do when I do...), but I
                  get Gallery2 off svn and don't really want to mess with their otherwise
                  excellent code...
                  Well if they use a PHP script to create|deliver their CSS and they do
                  not set the header with the content type then their "excellent" code is
                  flawed. Servers are configured (and rightly so) to serve PHP as
                  "text/html" and you do not want to change that. Your options are to put
                  the CSS in a file the the server is configured to serve as "text/css",
                  i.e., "someStyleSheet .css" *or* use the "header" function in PHP to set
                  the correct content type. That's it. The html attribute "type" will not
                  override how the server sends the file.

                  <a href="x.php" type="text/plain">won't work</a>

                  but

                  <?php
                  //x.php
                  header('Content-Type: text/plain');
                  echo 'hello world';
                  ?>

                  will.

                  --
                  Take care,

                  Jonathan
                  -------------------
                  LITTLE WORKS STUDIO

                  Comment

                  • Andreas Prilop

                    #10
                    Re: Firefox not applying style...

                    On Sun, 17 Feb 2008, Jonathan N. Little wrote:
                    header('Content-Type: text/css');
                    Rather
                    header('Content-type: text/css; charset=utf-8');
                    or other suitable charset.

                    --
                    Solipsists of the world - unite!

                    Comment

                    Working...