پیش‌نمایش زنده
کد HTML
<button class="button">
  <div class="wrap">
    <div class="outline"></div>
    <div class="content">Request a Consultation</div>
  </div>
</button>
کد CSS
.button {
  --white: #ffe7ff;
  --radius: 52px;
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  font-size: 23px;
  font-family: Arial;
  letter-spacing: -1px;
  border: 0;
  background: transparent;
  position: relative;
  width: fit-content;
  height: fit-content;
}

.wrap {
  border-radius: inherit;
  overflow: hidden;
  height: 100%;
  transform: translate(6px, -6px);
  padding: 2px;
  background: linear-gradient(180deg, #ff0042 0%, #ff6c3a 100%);
  position: relative;
  transition: all 0.3s ease;
}

.outline {
  position: absolute;
  overflow: hidden;
  inset: 0;
  opacity: 0;
  outline: none;
  border-radius: inherit;
  transition: all 0.4s ease;
}
.outline::before {
  content: "";
  position: absolute;
  inset: 1px;
  width: 120px;
  height: 300px;
  margin: auto;
  background: linear-gradient(
    to right,
    transparent 0%,
    white 50%,
    transparent 100%
  );
  animation: spin 5s linear infinite;
  animation-play-state: paused;
}

.content {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: relative;
  height: 100%;
  gap: 16px;
  padding: 12px 20px;
  color: white;
  font-size: 18px;
  border-radius: calc(var(--radius) * 0.85);
  font-weight: 500;
  transition: all 0.3s ease;
  background: linear-gradient(180deg, #ff0042 0%, #ff6c3a 100%);
}

.button:hover .outline {
  opacity: 1;
}

.button:hover .outline::before {
  animation-play-state: running;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
نوع: button
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05