<div>
  <a href="javascript:;">Button Link</a>
  <a href="javascript:;" class="button">Button Link</a>
</div>

<div>
  <button role="button">Real Button</button>
  <button class="button" type="button">Real Button</button>
</div>

<div>
  <a href="javascript:;" class="button button--small">Share</a>
  <a href="javascript:;" class="button button--small">Learn More</a>
</div>

<div>
  <a href="javascript:;" class="button button--block">✨ Share on MySpace</a>
</div>

<div class="card">
  <h2>Card</h2>
  <p>A card of wonders.</p>
  <a href="javascript:;" class="button button--small button--centered">Magic</a>
</div>
// Read about this:
// @link https://moderncss.dev/css-button-styling-guide/

$btnColor: #3e68ff;

* {
  box-sizing: border-box;
}

a,
button {
  font-size: 1.5rem;
}

// Reset default link styles
a.button {
  text-decoration: none;
}

// Reset default button styles
button.button {
  border: none;
  background-color: transparent;
  font-family: inherit;
  padding: 0;
  cursor: pointer;

  @media screen and (-ms-high-contrast: active) {
    border: 2px solid currentcolor;
  }
}

a.button,
button.button {
  // Display
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start; // Optional - see "Gotchas"

  // Visual
  background-color: $btnColor;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.18);

  // Size
  padding: 0.25em 0.75em;
  min-width: 10ch;
  min-height: 44px;

  // Text
  text-align: center;
  line-height: 1.1;

  transition: 220ms all ease-in-out;

  &:hover,
  &:active {
    background-color: scale-color($btnColor, $lightness: -20%);
  }

  &:focus {
    outline-style: solid;
    outline-color: transparent;
    box-shadow: 0 0 0 4px scale-color($btnColor, $lightness: -40%);
  }

  &--small {
    font-size: 1.15rem;
  }

  &--block {
    width: 100%;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Baloo 2", sans-serif;
}

div:not(.card) {
  display: flex;
  align-items: center;
  width: 100%;

  > * {
    margin-right: 0.5rem;
    margin-left: 0.5rem;
  }

  + div {
    margin-top: 4rem;
  }
}

.card {
  // display: flex;
  // flex-direction: column;
  background: #f9f9f9;
  border: 1px solid #c9c9c9;
  padding: 1.25rem;
  border-radius: 8px;
  width: 80vw;

  h2,
  p {
    margin: 0 0 0.8em;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.