A good-looking button

Hover, focus and a pressed state are what make a button feel real.

CSS · A good-looking buttonBeginner
.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: #1d4ed8; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
buttonhoverfocustransition