tags:

views:

89

answers:

1

If it possible to use @import in a .css file to load a style sheet from another site? Specifically, I have a main style sheet for my site which loads in other (local) style sheets using @import. I'd also like to load in a jquery ui theme hosted by google, e.g.

@import "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css";

This does not seem to work - I wanted to check whether this is allowed before working out exactly where the problem is.

+1  A: 

That should work. Are you sure it is not loaded? What browsers does this happen in? Can you confirm using Firebug?

There is no mention of it not working in the w3 specs nor in the related MSDN Article (The latter applies to IE only of course).

According to those specs, adding url(...) around the address is optional, but try whether that yields better results.

Pekka
I'm trying to detect whether it's loaded in Firebug, but it does not appear in the list of css files that are loaded. Is this what you mean by confirming in firebug?
Tomba
I solved the problem - I foolishly tried to put a // comment in my css file, which prevented execution of the next line (the @import statement) - on changing this to a proper /* */ comment it works as expected. Thanks very much for the suggestions.
Tomba