Outline (Ghost) Button Template

This template offers a modern, transparent button with a colored border, perfect for secondary actions.

Often called a "ghost button", its subtle design is ideal for choices like "Learn More" or "View Details" that should not distract from the page's main call-to-action.

Screenshot of a transparent button with a colored outline and text.

Get Source Code Preview

About the Outline (Ghost) Button

An outline button provides a clean, minimalist aesthetic. By removing the background fill, it maintains a lower visual priority on the page, gracefully guiding users to less critical actions. The design relies on a clear border and text to define its shape and purpose. When the user interacts with it, the button fills with color, confirming its interactivity.

Features

Code Breakdown

The core styling for this button in its default state uses background-color: transparent and a colored border. A transition is applied to multiple properties, including background-color and color. On hover, these properties are flipped: the background fills with color, and the text color changes to ensure it remains readable. Padding is calculated using the calc() function to subtract the border width, ensuring consistent inner dimensions.

Code

Here is the complete code for the outline button template.

View Output