Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CSS & Button: How to override native CSS of html buttons element?

CSS & Button: How to override native CSS of html buttons element?

Problem

I try to apply to buttons an elegant CSS style I found. I need to keep buttons for semantic/accessibility reasons. But my nice CSS is conflicting with the button elements' native CSS style, and loosing to it.

How to override the natural CSS of html buttons' elements ?

/* CSS works for buttonis, doesn't work for buttons*/
button.btn, buttoni.btn {  
   ... 
}

http://jsfiddle.net/bkWNw/3/

Edit: The Buttons Element should look exactly like the buttonis elements.

Problem courtesy of: Hugolpz

Solution

Either use a CSS Reset, or set the border and outline to none.

border: none;
outline: none;

http://jsfiddle.net/bkWNw/5/

Solution courtesy of: Christian Varga

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

CSS & Button: How to override native CSS of html buttons element?

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×