Skip to content
Justice Tech School

Links That Look Like Buttons

Style an anchor as a button with padding, background and border radius. Keep it an anchor when it navigates and a button when it performs an action.

Example
<style>
  .btn { display: inline-block; padding: 8px 16px; background: #04AA6D; color: white; text-decoration: none; border-radius: 4px }
  .btn:hover { background: #059862 }
</style>
<a class="btn" href="#">Go to page</a>

Exercise

Make the link block like.

display: -block;

Quiz Test

When use a button instead of a link?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.