Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS won't load in Firefox/Netscape... 2

Status
Not open for further replies.

beeej21

Technical User
Jul 7, 2003
67
US
Hi all,
I have wasted the entire weekend trying to figure out why my CSS code doesn't work in Firefox/Netscape. It looks fine and works fine in IE, but not in the former mentioned. Can someone PLEASE take a look and help me out?

First of all, here's the website that I got the CSS style switcher code from:


They have an example here:
The problem I am having now, is that on my server, I cannot get my CSS to load initially on my page. However, as soon as I click on the style/theme switcher links, the alternate CSS loads. Again, this is only in Firefox/Netscape.

Here are the pages I am building:


Please click ENTER on the landing page. The page that loads after hitting ENTER does not load the designated CSS file in Firefox/Netscape.

I am a designer, but not much of a coder. And this CSS thingie is really starting to wear me down. I was so thrilled last Friday when folks helped me get the CSS images to work... but I didn't realize it was only working in IE.

I am hoping and praying that someone will have an easy answer for me. I was hoping to have my photography portfolio site completed before the weekend was over. That's not happening now.

Here are the links to the files:


 
I must be going crazy, because I just noticed that the CSS isn't loading in IE either when you first load the page! Arrrrghhhh!!!
 
It's probably happening because of this line:
Code:
charset "utf-8";
Either add "@" in front of it to read [tt]@charset[/tt] or simply remove it (I don't know why you would need it). As is, it is an illegal command that breaks all the rest of css file.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thanks for the post, Vragabond. I deleted that line in the CSS file.. and as my luck would have it, it still didn't solve my issue. It just simply doesn't want to load when the page loads.
 
I just looked at the site in both firefox an ie7 and they look the same. What is it not loading? However, I just refreshed both and the image of the girl on the left went away in both. Are you adjusting it now?


ck1999
 
That's strange, ck1999. I am not adjusting anything on the site. I wonder how it is that you were able to see the images upon loading the page, but lost them once you refreshed. It has never loaded for me when I get to page. Only after I click the theme buttons will the CSS file load.
 
I do not know what happened I must of clicked on the buttons at the top without realizing it.

However, If you disable javascript then you get the girl's picture on the left.

So you may want to post your javascript in the javascript forum. I do not know much about javascript but the css i think works fine.

ck1999
 
Forget my last post I still had javascript disabled.

Sorry about that

ck1999
 
It is the cookie that is the problem. If you remove the cookie for your domain and visit the site, you will see the styles. When you navigate from the page, a cookie will be created and that's where it breaks. It is because a cookie should be created with a name: style = [name of the stylesheet] however what it comes out is style = null. That means that the title attribute gets lost somewhere in the process. That is why anyone seeing your page for the first time will see the stylesheets loaded perfectly (no cookie) and on subsequent visits it will not work (cookie set incorrectly). Follow ck1999's advice and ask what is wrong with your coookie creating function in the forum216.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thank you for the explanation and the advise, Vragabond and ck1999. I've posted my issue on the Javascript section of the forums. Hopefully someone will know of a quick fix to my problem. Thanks again for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top