I have a linked style sheet that alters the look of an input button. I do not want to use that style assignment on one specific page. I want the button to be just a generic, no-frills, default button. There are other styles on this style sheet I absolutely have to have, so I can’t NOT include the link, nor can I delete the styles controlling the look of the button as other pages that use this style sheet need it.
I would suggest that you’re falling into a trap: you’ve got a rule that is too general (it applies to *all* input [button]s, but you don’t *want* it to apply to all of them). You’re fighting a specificity war, and it creates bloated, fragile CSS.
Instead of adding a class or id to the input(s) that should be excluded, you should take the opposite approach and add a class to all the other input(s) that should be *included*:
Traq, my problem is that I’m being brought into a project that already exists, already has multiple style sheets and, quite possibly, hundreds of pages already functional. I don’t know the number of pages this particular style sheet touches, so I don’t want to willy-nilly start writing or re-writing stuff.
I completely agree with your thoughts, but at this point, I’m not sure that’s feasible. :)
Class will do of course, but it’s not right way to be done. ID is for single use right selector. It helps you to know when you see it “hey this is used just once, on one place”. And @Dami needs exactly that.
Oo? You are talking like someone will die. :) It’s not that big deal to use ID to override some rule. Actually in this specific situation is far better to do so than to add probably 20+ class attributes in HTML.
Since we’re developing a web app for the client to sell, it’s hard to say what the end users will be using. The boss said they would probably be using more modern browsers, so not to spend a lot of time correcting for pre-IE9.
I understand the basic premise of polyfilling, but have never (knowingly) put it into practice.