پیش‌نمایش زنده
کد HTML
<div class="btn">
  <span class="noselect">Button</span>
</div>
کد CSS
.btn {
  width: 150px;
  height: 50px;
  border: 1px solid #333;
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  transition: 1s;
  color: #000;
  font-family: sans-serif;
}

.btn::before,
.btn::after {
  position: absolute;
  background: #e8e8e8;
  z-index: -1;
  transition: 1s;
  content: "";
}

.btn::before {
  height: 50px;
  width: 130px;
}

.btn::after {
  width: 150px;
  height: 30px;
}

.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.btn:hover::before {
  width: 0px;
  background: #e8e8e8;
}

.btn:hover::after {
  height: 0px;
  background: #fff;
}

.btn:hover {
  background: #fff;
}
نوع: button
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05