Back

CSS premium card

Tutorial on how to create a beautiful premium card - HTML & CSS only.

Video tutorial

You can find the video with step-by-step guide on youtube:

Whole code

<div class="card">
  <span>PREMIUM</span>
</div>

<style>
.card {
  position: relative;
  width: 250px;
  height: 150px;
  border-radius: 20px;
  background-image: linear-gradient(to top left, #555555, #e4e4e4);
  clip-path: polygon(102% -2%, 102% 102%, -2% 102%, -2% -2%);
  font-weight: 600;
  transition: .3s;
  cursor: pointer;
}
.card:hover {
  transform: scale(1.1);
  transition: .3s;
}

span {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(45deg, #540a44 0%, #ef8ad9  51%, #540a44  100%);
  transform: rotate(-45deg) translate(-57px, 0);
  width: 200px;
  height: 40px;
  top: -10px;
  left: -10px;
  box-shadow: 0 15px 10px -13px black;
  color: #fff;
}
span::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  left: 3px;
  bottom: -7px;
  background-color: #540a44;
  clip-path: polygon(0 100%, 100% 0, 0 0);
}
span::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  right: 2px;
  bottom: -7px;
  background-color: #540a44;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

</style>
      
Thank you for reading this article.

More cards

Similar

See also