Oleksandr IY
Oleksandr IY

Reputation: 3106

`@import` doesn't include styles even url is 100% correct

I try to include css style.

@import url("http://mydomain.com/theme/css/reset.css")

but styles have not been included

When I open http://mydomain.com/theme/css/reset.css in the browser all is loaded and I can see css rules. What I do wrong?

Upvotes: 0

Views: 53

Answers (1)

agconti
agconti

Reputation: 18093

@import requires a semicolon:

@import url("http://mydomain.com/theme/css/reset.css");

From MDN https://developer.mozilla.org/en-US/docs/Web/CSS/@import

@import url;
or
@import url list-of-media-queries;

where :

url Is a or a representing the location of the resource to import. The url may be an absolute or relative url. Note that the url needn't actually specify a file; it can just specify the package name and part, and the appropriate file will be chosen automatically (eg. chrome://communicator/skin/). See here for more information.

list-of-media-queries Is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. If the browser doesn't support any of these media types, it won't even load the linked resource.

Upvotes: 3

Related Questions