2

Добрый день! Подскажите, как реализовать такую кнопку:

скриншот кнопки

Интересуют именно линии в углах кнопки, выделенные на скрине.

1 ответ 1

4

* {
  box-sizing: border-box;
}

body {
  background: #0A1527;
}

.btn {
  display: inline-block;
  padding: 15px 25px;
  min-width: 200px;
  text-align: center;
  color: #fff;
  background: #101A2D;
  position: relative;
  transition: .3s;
}

.btn:before,
.btn:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  border: 2px solid #565D6B;
  border-right: none;
  border-bottom: none;
  transition: transform .5s;
}

.btn:after {
  top: auto;
  left: auto;
  bottom: 0;
  right: 0;
  border: 2px solid #565D6B;
  border-left: none;
  border-top: none;
}

.btn:hover {
  background: #f00;
}

.btn:hover:before {
  transform: translate(-5px, -5px);
}

.btn:hover:after {
  transform: translate(5px, 5px);
}
<a href="#" class="btn">Button</a>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.