Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Your opinion on !important declaration please
Hi groovey TXP peoples,
I am making the templates for a big multinational corporation website and have submitted a quick draft to the back-end developers.
One of the comments surprised me. They referred to the !important declaration as a hack. What is your take on the !important declaration.
Let me have it lol.
I think, therefore I AM, … … er … I think :-?
Offline
Re: Your opinion on !important declaration please
not a hack, but…..use should be limited.
I generally only use it where I don’t have full contol of all included css.
Like a social network that allows you to apply secondary sheeets but has a default in place.
Offline
Re: Your opinion on !important declaration please
No, it’s not a hack.
Though I will try to avoid them where possible as I find it can make it harder to follow what doing what. But saying that I have been know to use them when rushed and as Walker pointed out they certainly are very useful styling a site you don’t run.
Offline
Re: Your opinion on !important declaration please
Clear as crystal.
That’s how i see things but it’s good to have a second, third, fourth opinion sometimes…
Cheers
I think, therefore I AM, … … er … I think :-?
Offline
Re: Your opinion on !important declaration please
IE6 does not respect the !important attribute so for a long time it was used as a way to get around rendering differences. Maybe that’s why they think it’s a hack.
It’s a value tool in dealing with the cascade.
Shoving is the answer – pusher robot
Offline
Re: Your opinion on !important declaration please
Cheers Hakjoon,
Thx for the feedback, every little helps.
But actually that’s a misconception about IE6. It actually does PARTIALLY respect the !important attribute.
The only time it doesn’t is when the same css property is declared twice in a selector. e.g.
h2 {
width:100px !important;
width:50px;
}
Only in this instance will IE6 ignore the !important attribute, otherwise it works fine in IE
Last edited by Timid&friendly (2008-12-12 16:12:30)
I think, therefore I AM, … … er … I think :-?
Offline
#7 2008-12-15 05:51:50
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Your opinion on !important declaration please
It could be hackish, depends on how you’re using it. :)
Offline