By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Firefox not applying style...

P: n/a
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=imageframe.CSS&amp;g2_frame s=none%7Cpolaroids"/>
<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
http://www.gdargaud.net/
Feb 16 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Guillaume Dargaud wrote:
PS: anyone can recommand a forum for FF-specific questions of this type ?
Thanks.
http://support.mozilla.com/forum
Feb 16 '08 #2

P: n/a
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=imageframe.CSS&amp;g2_frame s=none%7Cpolaroids"/>
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
Feb 16 '08 #3

P: n/a
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=imageframe.CSS&amp;g2_frame s=none%7Cpolaroids"/>
<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 '/>'.
Feb 16 '08 #4

P: n/a
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_mimetype = "" in php.ini

Doesn't sound normal to me...
--
Guillaume Dargaud
http://www.gdargaud.net/


Feb 17 '08 #5

P: n/a
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_mimetype = "" 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
http://www.LittleWorksStudio.com
Feb 17 '08 #6

P: n/a
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
Feb 18 '08 #7

P: n/a
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
http://www.gdargaud.net/
Feb 18 '08 #8

P: n/a
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
http://www.LittleWorksStudio.com
Feb 18 '08 #9

P: n/a
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!
Feb 18 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.