I hope someone can help me with a very vexing problem. After upgrading to Safari 4, the stylesheet for my website doesn’t load. The site worked fine in my previous version of Safari and the stylesheet loads properly in all the other browsers I have tested including Firefox, IE6/7/8, and Opera.
The stylesheet validates with the exception of an IE hack that I used. I tried embedding the stylesheet and this works fine. I have played with absolute and relative paths to the stylesheet to no avail.
Initially I suspected a bug in Safari 4. However, I am not having any problems with any other website viewed with Safari 4. I haven’t been able to find much information on the net and would appreciate any ideas or suggestions.
NOTE: I initially posted the link to this website but as a new user with no previous posts, I am not allowed to include links in this post. If anyone want to view the website, please email me for the link (emoshurchak@yourlink.ca).
I don’t know what the problem is. It’s a bug and after removing just about everything from the <head> I came to a conclusion-you are probably going to have to force safari 4 to load hte stylesheet via JS.
I also tried a minimal stylesheet without success. I tried your idea of using JS to load the stylesheet but again, no luck! Interesting to note that the browser specific code identified my version of Safari as Netscape 5. Go figure! Anyway, thanks for your suggestion.
If there is a bug in Safari 4.0 I’d like to notify Apple but I want to make sure that I haven’t overlooked some simple, embarrassing solution (wouldn’t be the first time). If anyone has an earlier version of Safari, I would like to confirm that the stylesheet loads properly.
Thanks for confirming the bug Ryan. I don’t understand why this bug hasn’t appeared in any other website I’ve visited (it may still of course).
I did use a JS snippet to identify the browser and load the stylesheet accordingly (you can see it commented out in the page source) with an “if” catch-all in case the browser didn’t identify correctly. As I mentioned, my Safari 4 was identified as “Netscape 5”!
I tried to login at the link you sent and got an error message “An error has occurred. Please report the error to Apple Inc. by emailing the error detail to devbugs@apple.com.”
I followed the instruction and will update this thread if/when I get a response.
I thought perhaps it would appear on my site as I use <link> but it only happened in yours which is really werid. I would like to learn more about this bug if Apple deems it a bug (which they should)
I will update this thread as I get more information back from Apple. At present I have been getting errors when trying to use the Apple Bug Reporter. I have sent the report in via Safari -> Report Bugs to Apple.
I too can reproduc this issue. However, I managed to remedy the issue by referencing to your stylesheet locally. I also uploaded that stylesheet to an external server and tested it, and it worked fine.
I’d check your server config, especially how you serve up the CSS file type. Although it’s expecitly declared in your LINK declaration as the ‘text/css’ content-type, it may be some server setting which is incorrectly overriding this.
I never thought to check the server configuration as I have another site on the same server that is working fine. I have passed this information along to the ISP technical support. Thanks for your help.
This isn’t a bug; Safari 4 is exhibiting the expected behaviour. All the ‘type’ attribute in the LINK declaration does is “…give an advisory hint as to the content type of the content available at the link target address. It allows user agents to opt to use a fallback mechanism rather than fetch the content if they are advised that they will get content in a content type they do not support.”
It appears that Firefox takes the value of the ‘type’ attribute quite literally, and this appears to champion whatever is declared as the content-type that is sent in a server request.
I’m too having problems with Safari 4. Up until now my site looked fine but with the safari 4 it has implement CSS in the some form of free jazz, never quite the same layout twice mingled . co . uk / index . htm Works fine in all other browers, including safari 3.
The bizarre thing is that when testing the page locally on my Mac there are no troubles at all, only when on the host server. I use a Linux server with GoDaddy but I’m not at all knowledgeable in this area. What should and where should I check?
The markup errors were due to some troubleshooting JS that I was using. I have corrected them but they were not the cause of the problem. The markup error in the CSS file is due to an IE hack that I was using. Removing this code does not solve the problem.
As I stated earlier, the CSS works fine in Safari 4.0 when embedded in an html file but does not work from an external CSS file. All other browsers that I have tested including earlier versions of Safari have no problem finding and loading this external file.
emos, when I made my last post, I was referring to the issue that GavinD is having.
Your issue however, is still to do with the server setting the wrong Content-Type for the stylesheet. As I mentioned this isn’t a bug; you need to set the Content-Type on the server to ‘text/css’