Tomba
Tomba

Reputation: 1743

css @import external style sheet

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.

Upvotes: 18

Views: 32303

Answers (1)

Pekka
Pekka

Reputation: 449395

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.

Upvotes: 15

Related Questions