I am using the django framework and am using templates, inheriting a lot of admin base templates. What am wondering is: can I have more than one CSS file in one HTML file? i.e. maintain the django admin CSS file but then have another CSS file of my own with different styles!
+1
A:
Yes, you can. But if you try to override any of the CSS in the django admin CSS, you'll have to use !important in your style definitions.
Salty
2009-01-06 20:58:14
Not necessarily - you just have to define yr CSS using more 'specificity' so that your rules take precedence over the django CSS. Using !important can cause problems when trying to debug your CSS further down the line, so I'd suggest you use it with caution.
codeinthehole
2009-01-06 21:21:05
+8
A:
Yes you can. Just place the tags to the CSS files or embed the style in style tags.
Ricardo Acras
2009-01-06 20:59:02
A:
Of course, that's why they are called Cascading Style Sheets, because you can have a dozen of them applied in succession.
Karl
2009-01-06 21:00:41
No, they are called Cascading Style Sheets because the rules *cascade* through the document. Not because you have lots of them applied in succession.
Ryan Doherty
2009-01-06 21:11:01
Just don't try 3 dozen... http://www.agum.com/web/2008/03/11/internet-explorer-issue-maximum-of-32-css-import/(Also, ryan's comment++)
Andy Ford
2009-01-06 21:38:46
+1
A:
Just to add that whilst multiple css files are of course possible, it is actually best practice for you to merge the css (programatically if possible) into as few files as possible.
Fewer files = fewer http requests = better responsiveness for the end user.
annakata
2009-01-06 21:16:08