Eight simple CSS button styling examples. Straightforward design - no animations, no fading.
Calls to action and links with emphasis, buttons are an integral part of the navigation of any website. They guide navigation, grab attention, and reinforce your site’s branding. A good button should stand out just enough to say, "Click me," without shouting over the rest of your design.
Often, a simple design is best: a solid color with contrasting text, or a white button with colored text and border. Rounded corners give a softer look; sharp corners feel bold and direct. Want to push the look a bit further? Try slanting the button for visual interest - just be ready for a few extra styling challenges.
Then there's the hover state to consider - especially on desktop. A button should look interactive when hovered over, with styling that clearly changes. That might mean darkening, lightening, or shifting the background color entirely. A white button with dark text might invert to dark with white text. The effect can be subtle or bold, depending on the look you're going for. The important thing is that the shift is noticeable.
If you're looking to add a little polish, consider a subtle transition between the default and hover states. When you're ready to level up, check out this post for examples of button transitions and animations.
Below are eight examples of how to style simple buttons for your website. For this demonstration, each button is a <div> wrapped in an <a> tag, rather than a <button> or <input> element. This setup offers more flexibility and ease when styling. Anchor (<a>) tags alone can be temperamental with padding, while <button> elements don't naturally navigate anywhere—you'd need JavaScript or an anchor wrapper to make them clickable. As for <input> buttons, they're limited to forms and come with their own quirky styling behaviors.
That’s why the base structure for the buttons in this post looks like this:
<a href="#"><div>Click here!</div></a>