Jump to content

css - safari problem


campgus

Recommended Posts

Hi all,First time posting here.I re-did a website using strict xhtml code and css.It works perfectly in IE and in Firefox, but Safari and Chrome do not read the css file and I am left with plain text.Both the xhtml and css validate properly. I've used virtually the same css file for other websites and they all work fine. (both in Chrome and Safari) Could it be a server problem? I am on a test site developing this so the old site is not interupted.Gus

Link to comment
Share on other sites

(both in Chrome and Safari) Could it be a server problem? I am on a test site developing this so the old site is not interupted.Gus
Its hard to say without seeing any of the markup or CSS. It could be a server problem: do you have the @type attribute set on the <link> element for the stylesheet. Try setting it to text/css if not. The server could be sending a bad mime type and IE and FF might just be more forgiving in this respect.It could also be something simple, like an unclosed CSS comment or rule that gets parsed differently in IE and Firefox. If you say no style gets applied at all, its most likely that these would be near the top of the file.One thing you can do to investigate things more is to open the inspector tool in chrome and type document.styleSheets into the console, and look to see if your stylesheet actually got loaded into the DOM. If it was loaded, you can rule out the possibility of it being a problem with the markup or server because its definitely a problem with the CSS itself. Then, looking at the document.styleSheets list, you can look at how many rules of your styleSheet were actually applied. If not that many rules were applied, that means its probably a simple parse error like an unclosed curly brace.All that aside, it also might be a strange instance where the CSS file is cached for IE and FF, but not chrome or safari. This seems less likely than the previous scenarios being that safari and chrome both use webkit, and that would end up being a coincidence. So make sure the CSS file actually exists, and that the path is correct. Clear your cache on all browsers.
Link to comment
Share on other sites

Thanks for the reply.Here is the url to the site I am working on: http://wirechief.com/nwprrhs/index.htmlWhen I click the css validation button, while using Chrome, it finds the css markup and the validation passes.If the validator finds the markup, why dosen't Chrome use it?Where do I find the inspector tool in Chrome? I have the latest version installed.I opened Tools - developer tools - console at the prompt I typed document.Stylesheets <enter>got "undefined"Gus

Its hard to say without seeing any of the markup or CSS. It could be a server problem: do you have the @type attribute set on the <link> element for the stylesheet. Try setting it to text/css if not. The server could be sending a bad mime type and IE and FF might just be more forgiving in this respect.It could also be something simple, like an unclosed CSS comment or rule that gets parsed differently in IE and Firefox. If you say no style gets applied at all, its most likely that these would be near the top of the file.One thing you can do to investigate things more is to open the inspector tool in chrome and type document.styleSheets into the console, and look to see if your stylesheet actually got loaded into the DOM. If it was loaded, you can rule out the possibility of it being a problem with the markup or server because its definitely a problem with the CSS itself. Then, looking at the document.styleSheets list, you can look at how many rules of your styleSheet were actually applied. If not that many rules were applied, that means its probably a simple parse error like an unclosed curly brace.All that aside, it also might be a strange instance where the CSS file is cached for IE and FF, but not chrome or safari. This seems less likely than the previous scenarios being that safari and chrome both use webkit, and that would end up being a coincidence. So make sure the CSS file actually exists, and that the path is correct. Clear your cache on all browsers.
Link to comment
Share on other sites

Curious. In Safari, I can use the address bar to directly load every .css document that I've tested. But for yours, I get this message:The URL you asked for does not exist on this websiteSince accessing the document this way uses the same request method that the browser uses when getting a css file normally, I'm guessing the browser is simply not receiving it at all.I have no idea why that should be.

Link to comment
Share on other sites

Curious. In Safari, I can use the address bar to directly load every .css document that I've tested. But for yours, I get this message:The URL you asked for does not exist on this websiteSince accessing the document this way uses the same request method that the browser uses when getting a css file normally, I'm guessing the browser is simply not receiving it at all.I have no idea why that should be.
Quite interesting. My ftp software says it is there. Google Chrome shows it as being there, and displays it, but will not use it to style the page.I'll ask the web server host if he has any ideas about this problem.Gus
Link to comment
Share on other sites

Ask about mime-types. It should not be the problem, but who knows? I've never heard of this.
The problem turned out to be on the server end. He added a line of code to his config file and now all is well.I pull out a lot-o-hair over this.Thanks to all who helped me search for a solution.Gus
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...