It is not @import have @import inside the @media , so what you have will not work.
The right way to do this is even easier - @import itself accepts the media request after the URL:
@import url('/css/styles-480.css') only screen and (max-width: 480px);
This syntax is presented in CSS2.1 for use with media types , but will also work as they are a direct extension of media types.
Remember that @import rules can only exist at the beginning of a stylesheet.
If you are concerned about loading, you can use the separate <link> element in the page title to refer to this stylesheet instead of @import , as shown by Assad . However, any method will work fine.
source share