Home Tech Geek Web Development Solution to: Why isn’t my css @import statement working?

Get social!

This is a quickie. I couldn’t figure out why the following statement (located inside a file called “default.css”) wasn’t being retrieved by the web browser:

@import url(‘../my-theme-addons/style.css’);

Solution

You need to put all “@import” statements before all other content when importing from a css file. Assuming everything else is correct, just put the line at the top of your file and you’ll be fine.

Thanks to this site for the answer:

http://www.cssnewbie.com/css-import-rule/#.Um5PPGRASJY

Leave a Reply

Bad Behavior has blocked 17 access attempts in the last 7 days.