1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Safari & @import issue.

Discussion in 'CSS' started by Greg-J, Mar 12, 2008.

  1. #1
    I've never seen this before and I'm having trouble finding any information on it, but it seems Safari has an issue with embedding @import into a stylesheet.

    For instance:

    WordPress requires that a style.css be found in a theme directory but I prefer to keep my stylesheets in a /style sub directory. Therefore, beyond the comments WP requires - my style.css is simply:
    @charset "utf-8";
    	@import url(style/reset.css);
    	@import url(style/structure.css);
    	@import url(style/widgets.css);
    	@import url(style/global.css);
    Code (markup):
    FireFox and IE have no issues, but Safari on OSX will not render any style whatsoever.

    I've tried using all know @import formats as well:
    @import "";
    @import url();
    @import url("");
    Code (markup):
    It doesn't make any difference.

    For now I'm simply calling them all independently and it saves a server call - but the issue has intrigued me to learn more about it.


    Has anyone else experienced this issue? Found an explanation?
    SEMrush
     
    Greg-J, Mar 12, 2008 IP
    SEMrush
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,410
    Likes Received:
    349
    Best Answers:
    26
    Trophy Points:
    335
    #2
    Konqueror 3.5 and Safari 2 do not support the @charset at-rule. Perhaps that's throwing a wrench in the works. Have you tried it with that removed?

    You might also run the stylesheet with the rules through the W3 validator to make sure you don't have some little syntax hic-cough that the KHTML/Webkit engines don't like.

    cheers,

    gary
     
    kk5st, Mar 12, 2008 IP