پیش‌نمایش زنده
کد HTML
<button>
    Button
</button>
کد CSS
button {
  width: fit-content;
  height: 45px;
  background: #ffffff0d;
  border-radius: 8px;
  border: 2px solid #334b79;
  font-size: 15px;
  font-weight: bold;
  color: #334b79;
  -webkit-transition: 0.5s all ease;
  transition: 0.5s all ease;
  position: relative;
  overflow: hidden;
  padding: 10px 25px;
  z-index: 1;
}

button:before {
  width: 50%;
  height: 100%;
  content: "";
  margin: auto;
  position: absolute;
  top: 0%;
  left: -50%;
  background: #334b79;
  transition: all 0.5s ease;
  z-index: -1;
}

button:after {
  width: 50%;
  height: 100%;
  content: "";
  margin: auto;
  position: absolute;
  top: 0%;
  left: 100%;
  background: #334b79;
  transition: all 0.5s ease;
  z-index: -1;
}

button:hover {
  color: white;
  cursor: pointer;
}

button:hover:before {
  top: 0;
  left: 0;
}

button:hover:after {
  top: 0;
  left: 50%;
}
نوع: button
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05