I want to use a css file for applying a theme. I am using myfaces that has one custom component named Scheduler. Scheduler component is using its own css file that is within jarfile(tomahawk12-1.1.10.jar) named schedule.css and has three theme(default , outlook, and evelutionary) but I want to use my own css file for applying theme in my project. How can I overwrite that css file?
Asked
Active
Viewed 3,730 times
3
-
2If you create your own css file with the same css classes and include after those other files, your rules will overwrite the previous ones. – ldg Sep 06 '11 at 05:43
1 Answers
3
Well it depends on if you want to completely overwrite the CSS files by changing their contents (just save over the files and possibly keep a backup copy), or if you want to just use the !important
feature with your own custom stylesheet in CSS, exampled below:
leftSide {
background-color: #0f0 !important;
}
When the !important
declaration is used on a specific property/value pair, it will cause that particular value to escape the cascade and become, as the name suggests, the most important value for that property, overriding any others.
Here is more information on CSS's !important
feature: http://www.impressivewebs.com/everything-you-need-to-know-about-the-important-css-declaration/

Glenn Dayton
- 1,410
- 2
- 20
- 38
-
3In most cases one don't need the `!important`-rule to overwrite CSS statements. Just repeat the selector and add it after the original (file). »[`!important` can be highly abused and make for messy and hard to maintain CSS](http://css-tricks.com/9462-when-using-important-is-the-right-choice/)« – feeela Sep 06 '11 at 09:26