* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.wrap {
  width: 100%;
  display: flex;
}
.item {
  width: 25%;
  position: relative;
}
.item img {
  width: 100%;
  vertical-align: middle;
}
.item .txt {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s;
}

.item:hover .txt {
  opacity: 1;
}

.item .txt h2 {
  font-size: 28px;
  color: #ff0;
}
.item .txt h2::after {
  content: "";
  display: block;
  width: 0%;
  height: 2px;
  margin: 10px 0;
  background-color: #ff0;
  transition: width 0.5s 0.2s;
}
.item:hover h2::after {
  width: 100%;
}

.item .txt p {
  font-size: 18px;
  color: #fff;
}
