css - style for all buttons except ones with a class

Hi, I have a css file that defines a style for all buttons :


input[type="button"], input[type="submit"]{
	
	 font: 12px / 16px "segoe ui", arial, sans-serif; color: white;
    border: 2px solid #0072c6;
    padding: 2px 10px 1px 10px;
  
  background: #0072c6;
  cursor: pointer;
  display: inline-block;

}

input[type="button"]:hover, input[type="submit"]:hover{
	
	 font: 12px / 16px "segoe ui", arial, sans-serif; color: white;
     border: 2px solid #25a0da;
     padding: 2px 10px 1px 10px;
  background: #25a0da;
  cursor: pointer;
  display: inline-block;

}

input[disabled][type="submit"] 
{
    	 font: 12px / 16px "segoe ui", arial, sans-serif; color: white;
    border: 2px solid #a3bbc9;
    padding: 2px 10px 1px 10px;
  
  background: #a3bbc9;
  cursor: pointer;
  display: inline-block;
}

Open in new window


the problem I have is that a third party control has no definition for their own buttons hover - so when you hover over their nice image button it's replaced with a nice blue square!

their buttons always have a class defined whereas none of my buttons have a class.

is there any way to cancel the above style Only for buttons with a class - ANY class, not a single specific class?
LVL 1
PatrickK_WAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
their buttons always have a class defined whereas none of my buttons have a class.
If you are going to change the default style of an element - best practice is use a class. If you style the element then you are going to run into these sorts of issues.

Right answer - put classes on your buttons.

You can define styles on the class of the button on the plugin but that is going to be tedious. My advice is put classes on your buttons and style those.
RobOwner (Aidellio)Commented:
I agree with Julian, it's like having global variables and being surprised when one is overwritten.  Putting elements within containers such as a class is a VERY good idea.

That being said, the :not() selector may work for you: http://jsbin.com/diwura/edit?html,css,output

input[type="button"]:not([class]), input[type="submit"]{
	
	 font: 12px / 16px "segoe ui", arial, sans-serif; color: white;
    border: 2px solid #0072c6;
    padding: 2px 10px 1px 10px;
  
  background: #0072c6;
  cursor: pointer;
  display: inline-block;

}

input[type="button"]:not([class]):hover, input[type="submit"]:hover {
	
	 font: 12px / 16px "segoe ui", arial, sans-serif; color: white;
     border: 2px solid #25a0da;
     padding: 2px 10px 1px 10px;
  background: #25a0da;
  cursor: pointer;
  display: inline-block;

}

input[disabled][type="submit"] 
{
    	 font: 12px / 16px "segoe ui", arial, sans-serif; color: white;
    border: 2px solid #a3bbc9;
    padding: 2px 10px 1px 10px;
  
  background: #a3bbc9;
  cursor: pointer;
  display: inline-block;
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatrickK_WAuthor Commented:
thanks, I appreciate it should have a class on the buttons and will get around to updating it all, but the work around s very handy for the one control causing the issues.

thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.