Forum Moderators: mack

Message Too Old, No Replies

CSS won't load in FF2.0.0.12

Having problems with Firefox

         

deeburz

4:22 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



Hi, I am redesigning my site and having a problem. I have coded one template page and uploaded it to my server along with the .css. I coded according to w3schools.com and validated both the HTML and CSS with the validators at w3.org. IE displays the page as coded, but Firefox will not load the stylesheet for the page. Please view the page's code and css at:

Having hand-coded and validated, I cannot figure out what is wrong. I also added MIME Type "text/css" with extension ".css" to the MIME Types of my server. I think this adds the line to my .htaccess file. Please help, and thanks.

[edited by: jatar_k at 7:59 pm (utc) on Mar. 24, 2008]

coopster

7:58 pm on Mar 24, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, deeburz.

Personal urls are not allowed per the Terms of Service here at WebmasterWorld. You will want to use examples in the future as I'm certain that url is going to be clipped out.

In Firefox you can open the Tools > Error Console and view all kinds of information. For instance, on your site ...

Warning: Unexpected end of file while searching for ',' or '{'. Ruleset ignored due to bad selector.
Source File: http://example.com/new/style.css
Line: 1

Warning: Unexpected end of file while searching for closing } of invalid rule set.
Source File: http://example.com/new/style.css
Line: 1

deeburz

9:49 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



Hi, sorry about stepping on the rules, I'll learn. =\ Thanks for the tip about the error console, I just downloaded Firefox too and I'm not used to it. The first line of my .css sheet reads:

a:link {color: blue; text-decoration: none}

I formatted it this way according to w3schools.com tutorials. Can you tell me where the comman (,) goes, and whether I should put another { in the lines somewhere? Thanks.

deeburz

3:45 pm on Mar 25, 2008 (gmt 0)

10+ Year Member



I couldn't edit my previous post, but I wanted to add a symptom to the problem.

I edited my style sheet and removed all spaces from the document, to see if this would help. I also added ; to the end of every statement inside {}. Previously I had omitted ; from the last statement in every {}. Neither of these changes have made the css load in Firefox, but IE still loads the style sheet fine.

I installed the Web Developer toolbar in Firefox, and a funny thing happens. When I click on "Edit CSS" in the CSS menu, the style sheet loads and the entire page becomes formatted as it should be. When I close the Edit CSS window, the style sheet is removed again. The question is, why isn't the .css loading when I view the page without the developer toolbar? The problem occurs when I view the page online and also when I open it from my computer, so it's not a server settings. It is something within Firefox, and other people get the same error. Please help! I can't finish my site until I get one page working properly!

EDIT: I can also apply the styles by clicking "Add User Stylesheet" and choosing the style.css from the directory. But when I reload the page, nada.

coopster

8:46 pm on Mar 26, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The CSS Forum [webmasterworld.com] here at WebmasterWorld has a great Library loaded with information including a Troubleshooting Refresher. Also, don't forget to check the headers being sent along with your CSS. Firefox has a great extension called LiveHTTPHeaders that you might want to check out.

Marcia

10:24 pm on Mar 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had that happen with a small bit of PHP, kept getting an error message about a : on a line - and there was none. I retyped the problem line into a new document and copied and pasted the surrounding lines around it. Error message stopped and it worked - but not a clue why.

Also check for < beginning and end > tags on other lines before and after references to the CSS; it's often an unclosed tag prior that causes problems further down (for me, anyway).