As originally discussed in exploring browser default styles, the button
element is heavily styled by browsers – more so than text elements like h2
or p
, where only the element’s font size, weight and spacing are styled.
In order to style buttons, I recommend a two-pronged approach:
- Use a
button-reset
class to strip all button styles away and make yourbutton
element look like the rest of the text on your page. - Use a second class to apply specific styles, like a background color or borders.
You can see this process step-by-step in the following demo: