[SOLVED] Stylesheet error in Firefox

acbot

Joined: 2005-02-17
Posts: 15
Posted: Tue, 2005-03-01 07:30

Hi there,
I am having issues with firefox not identifying stylesheets for G2. basicallly the output is htnl with no applied stylesheets..anyone else get this? i often find making a call to a stylesheet doesnt render in firefox. Got any solutions?

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Tue, 2005-03-01 09:27

no, never experienced something like that. you could describe the issue a little more in detail? are you talking about the stylesheets that come with G2 or did you edit the themes? and does it work in other browsers?

Login or register to post comments
acbot

Joined: 2005-02-17
Posts: 15
Posted: Tue, 2005-03-01 09:31

works fine in ie...
no unedited

i gett his problem quite frequently i find so i have startd to wonder if it is my install of firefox... i tried it on other computer with firefox here and got the same problem....basically the html displays fine but no css is applied...i know if i were to put the css styles inline it would solve this problem as i have done it before...it seems the call to the stylesheet fails in firefox...i dont think this is simply a gallery problem, rather a firefox one but i was wondering if others experienced this and how they resolved it..it seems rather fruitless to import all the external stylesheets inline when there is a call for external sheets.

Login or register to post comments
fryfrog

Joined: 2002-10-30
Posts: 3233
Posted: Tue, 2005-03-01 09:43

I usually only see this when I have something mucked up about my NAT firewall or a path somewhere in gallery or apache configs. For some reason its able to retrieve the html just fine, but not the css file. I think its most often seen with NAT problems, where the server answers the initial request for html just fine BUT when it spits out a link to a css file with a url like "http://192.168.1.2/something.css" of course the client then tries and tries and tries to get a file from a reserved, unroutable rfc address. Er, not unroutable but... not internet routable.

Login or register to post comments
acbot

Joined: 2005-02-17
Posts: 15
Posted: Tue, 2005-03-01 11:05

found the issue:

you either need AddType text/css .css in your apache httpd.conf or text/css css in your mime.types file.

thnaks..appernetly it is common so if anyone else experiences this problem try this

Login or register to post comments
JasonP

Joined: 2005-06-04
Posts: 6
Posted: Sat, 2005-06-04 19:15

That didn't work for me. Page displays nicely in IE, but it doesn't seem to read the css when using firefox. text/css css is in mime.types. I'm using G2 "out of the box". Haven't done any modifications.

http://gallery.ginnypig.net/

Any other suggestions?

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sat, 2005-06-04 19:22

JasonP, please upgrade to the current nightly snapshot from http://galleryupdates.jpmullan.com

and if the problem persists, it has to do with your apache configuration (sure about the AddType text/css for .css?). you need to restart the webserver after such a change.

Login or register to post comments
JasonP

Joined: 2005-06-04
Posts: 6
Posted: Sun, 2005-06-05 01:20

I tried the AddType text/css for .css also with Apache2 before posting. Yes, I did restart the server. The nightly build I'm using is about a week old. This problem has followed me the last few months through nightly builds/snapshots.

Thanks for the suggestion though.. Didn't work.. IE still wotking like a charm. Just would love making it look nice in firefox. Probably just a small error somewhere, but I can't seem to find it.

Thanks again..

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9025
Posted: Sun, 2005-06-05 02:21

You might want to double check your CSS files. They might be slightly corrupt or the carriage returns might be hosed.

Look at these links in Firefox.

Matrix theme.css from my site:
http://photos.kevinnehls.com/themes/matrix/theme.css

Matrix theme.css from your site:
http://gallery.ginnypig.net/themes/matrix/theme.css

Also, your install of G2 seems to generate session IDs behind all of the links, even to the CSS files. Mine does not.

I think it is a slight formatting problem with your CSS sheets though. If I use the "edit css" function of the Web Developer extension in Firefox then your site looks like it's suppose to. I assume probably because that add-on formats the CSS code or reads the carriage returns correctly.

Your carriage returns could've gotten screwed up by your FTP software. I've seen it happen all to many times.

Try opening up your CSS files locally in WordPad. If they look correct, then save them. Make sure you save them as a Text Document with the .css extension. You may also need to make sure you're not hiding extensions in Windows Explorer. Otherwise it will name them theme.css.txt One of the many "user friendly" (not) "features" (not) of Winbloze.

This is one of the reasons IE is so bloated it contains so much extra error handling code to make even poorly coded sites still look like they aren't broken. Note: I'm not saying your site is poorly coded, just ranting about IE. If a page is broken it should be displayed as broken, not what appears as correct.

Login or register to post comments
JasonP

Joined: 2005-06-04
Posts: 6
Posted: Sun, 2005-06-05 11:06

Thanks again.

For some reason whatever I do, the file looks messed up on my site. Even the MANIFEST file. I've tried using notedpad, wordpad, vim, nano and even unpacked the snapshot again and copied the file in shell over the old one, it still looks bad. Tried to empty the cache as well, since it might display the old file cached. I made the file look good in notepad and wordpad, but it still doesn't help in firefox. I'll look into this more closely later today I guess. If you have any suggestions as of why this happens, feel free :) Thanks so far!

Btw, the page looks messed up in IE as well, but that might be the errorhandling code as you said, that reads it correctly.

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2005-06-05 11:22

JasonP, what about some system information?
and a phpinfo link (<?php phpinfo.php(); ?>) link would also be interesting.
what about the file integrity? (systemcheck step in the installer) if you manipulated the MANIFEST files, first get the original MANIFEST files back in place. and are there other warnings?

Login or register to post comments
JasonP

Joined: 2005-06-04
Posts: 6
Posted: Sun, 2005-06-05 12:11

Haven't manipulated any files. Just untared the tarball and copied the files to it's directory. All files are original. I've only tried to fix the theme.css file, but it should also at the moment be back to the original from the tarball.

gallery2.2005-06-05-08-32-31.tar.gz

Gallery version = 2.0-beta-3+ core 0.9.22
PHP version = 4.3.10-15 apache2handler
Webserver = Apache/2.0.54 (Debian GNU/Linux) mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-15 mod_perl/1.999.23 Perl/v5.8.4
Database = mysqlt 4.0.24_Debian-10-log
Toolkits = Exif, ImageMagick, NetPBM, ArchiveUpload, Ffmpeg
Operating system = Linux ed 2.6.8-2-686 #1 Tue Mar 22 14:53:20 EST 2005 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Hope this phpinfo helps.

http://webmail.ginnypig.net/horde3/test.php?mode=phpinfo&url=%2Fhorde3%2Ftest.php

System Checks
PHP Version Success
FILE Directive Success
Safe Mode Success
exec() allowed Success
set_time_limit() allowed Success
Memory limit (16Mb) Success
File uploads allowed Success
Maximum upload size (10Mb) Success
Maximum POST size (8Mb) Success
Gallery file integrity Success

Login or register to post comments
JasonP

Joined: 2005-06-04
Posts: 6
Posted: Mon, 2005-06-06 14:38

Guess this might have something to do with it. Just have to figure out how to fix it since the mime.types seem to be right.

Error: The stylesheet http://gallery.ginnypig.net/themes/matrix/theme.css was not loaded because its MIME type, "text/html", is not "text/css".

Login or register to post comments
JasonP

Joined: 2005-06-04
Posts: 6
Posted: Mon, 2005-06-06 15:17

Works now.. I cheated and made a .htaccess file with the following info:

AddType text/css .css

Put it in the root gallery2 folder. For some reason it didn't help having the right info in the mime.types file nor the apache2 config file. So I had to rely on .htaccess. Well, as long as it works..

Thanks guys for providing me with help. I've learned a lot :)

Login or register to post comments
Styno

Joined: 2005-10-07
Posts: 2
Posted: Sat, 2005-10-08 09:46

Sorry to reopen this topic again, but I've got exactly the same problem as the topic starter: I'm running Apache2 on a Windows XP pro. development machine with G2. When a request is made on another pc with IE or FF browser the output only contains plain html. No pictures and no stylesheet.

These missing files are requested by the browser as e.g.: http://127.0.0.1/gallery/testsite/main.php?g2_view=search.SearchScan&g2_form%. I've checked this in the browser but also in apache log.

I've tried both solutions presented by acbot, but they didn't help in my case. I think the IP address part of the requested URL is the problem here, but I've got no clue how to solve that....

Edit: On tripple thought this problem might not be the same as abcot's but I hope someone is willing to give me a pointer still.

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sat, 2005-10-08 09:52

Styno
not sure if your issue is related. but your webserver is certainly misconfigured.
so what's your problem? somone accesses your g2 with a real domainname and all URLs that g2 generates have 127.0.0.1 (localhost) as the domain instead?
change the hostname in apache2 httpd.conf.

Login or register to post comments
Styno

Joined: 2005-10-07
Posts: 2
Posted: Sat, 2005-10-08 10:02

Thanks for you fast response valiant. The servername in the httpd.conf was the netbios name of my development machine. I've changed it to my domain name, hope this works.

Login or register to post comments
Henrikm

Joined: 2006-06-19
Posts: 2
Posted: Tue, 2007-01-16 17:10

For some reason Firefox cannot handle the text/css correctly if you for instance have a Forcetype, e.g. "ForceType application/x-httpd-php", in a higher level .htaccess. So this is probably the answer to most of these Firefox (and Netscape!) .css problems. Opera acts as MSIE.

Login or register to post comments
azpoulton

Joined: 2008-07-01
Posts: 1
Posted: Tue, 2008-07-01 17:07

Sorry to reopen the topic, but i was having the same problems and was able to fix them only by changing the link that was on my home page from <a href="/gallery2/main">Picture Gallery</a> to <a href="/gallery2/">Picture Gallery</a>. For some reason by having the 'main' in the link it caused my css and js to bug out.
see this topic:
http://gallery.menalto.com/node/79084

Login or register to post comments
amiktech

Joined: 2009-03-23
Posts: 1
Posted: Mon, 2009-03-23 15:55

I found dropping the style sheet into a subdirectory made the thing work for firefox

<link rel="stylesheet" type="text/css" href="http://www.domain.com/stylesheet/mysheet.css">

Login or register to post comments