DEV Community

loading...

Discussion on: How to create an HTML button that acts like a link?

Collapse
ricobrase profile image
Rico Brase

This.

Use a button for actions (save, delete, edit, etc. with corresponding navigation INSIDE of your own application, e.g. navigate to the edit page), but use <a href="https://example.com">Link text</a> for any sort of proper navigation, e.g. external links or internal links to separate parts of your app (user management, article management, etc.).

If you want to, you can style some links with <a href="https://example.com" class="button">I'm a button!</a> and some CSS for the .button rule.

Don't change the intended behaviour of elements to make them fit - change their look!