Snowcrash
Snowcrash

Reputation: 86077

@import url('my.site/my-style.css') not working

I have this line at the bottom of my WordPress style.css file:

@import url("http://my.site/wp-content/themes/mytheme/my-styles.css");

If I enter http://my.site/wp-content/themes/mytheme/my-styles.css into a web browser the file resolves and can be downloaded.

However, none of the styles in my-styles.css are being read.

Any suggestions?

Upvotes: 0

Views: 897

Answers (2)

Firefog
Firefog

Reputation: 3174

You If you want to create a custom CSS put your customization on it and make a file named my-styles.css and upload it on your theme main style sheet directory. then this will work as override the main style.

or example of how you can create a child theme and import the main CSS

Upvotes: 0

Caleb Anthony
Caleb Anthony

Reputation: 1123

The @import rule has to come first in your CSS file.

Upvotes: 1

Related Questions