I am using a CMS as a basis for a website. There are some special articles I wish to add and they require custom css.

To keep things tidy, I want to have unique css files for each of these special articles and invoke them using

@import url('filename.css')

However, the files will only load if the @import is at the top of the site css file. Does this make sense? By that logic, anything that appears below the @import will cancel what that which I am trying to code in a special manner. Is it not possible to have an @import at the end of a css file?

According to this page: http://webdesign.about.com/cs/css/qt/tipcssatimport.htm @import MUST be declared at the top of the file.

I can't say for certain since I do not know which CMS you are using but I know that E107, for one, allows you to create custom template/layout/css for any "pages" which are to be different from the main template/layout/css that you specify for the site.

Such as regular pages such as "Contact Us" may all be in one column on the page as with the rest of your 'general' pages but then you may want to have article pages where they should be split into two columns like a newspaper. E107 allows you to create "custom" layouts that differ from the main one specified and then you select which rule set you want your particular pages to follow.

It may be the same or a different workaround for whichever CMS you are using. Can't say for certain but if they do not offer a similar feature and you have to go with the import method then yes, it looks like it must be declared before anything else.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.