<section>
  <div class="btn btn__20">
    <a href="#">1-20.上下から扉が閉まる</a>
  </div>
</section>
section{
  display: flex;
  margin:2rem;
  justify-content: center;
  align-items: center;
}
.btn a {
  display: inline-block;
  text-decoration: none;
  border: 2px solid #333;
  color: #333;
  padding: .7rem 1.5rem;
  transition: .2s;
}

.btn.btn__20 a {
  overflow: hidden;
  position: relative;
  transition: .3s;
}

.btn.btn__20 a:before, .btn.btn__20 a:after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  margin: auto;
  width: 100%;
  height: 0;
  background-color: #2382e5;
  z-index: -1;
  transition: .3s;
}

.btn.btn__20 a:before {
  top: 0;
}

.btn.btn__20 a:after {
  bottom: 0;
}

.btn.btn__20 a:hover {
  color: white;
}

.btn.btn__20 a:hover:after, .btn.btn__20 a:hover:before {
  height: 50%;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.