پیش‌نمایش زنده
کد HTML
<div class="card">
<div class="card-img"></div>
  <div class="card-info">
    <div class="card-text">
      <p class="text-title">This is a title</p>
      <p class="text-subtitle">This is a subtitle</p>
    </div>
    <div class="card-icon">
      <svg viewBox="0 0 28 25" class="icon">
        <path d="M13.145 2.13l1.94-1.867 12.178 12-12.178 12-1.94-1.867 8.931-8.8H.737V10.93h21.339z"></path>
      </svg>
    </div>
  </div>
</div>
کد CSS
.card {
  width: 190px;
  height: 254px;
  position: relative;
  border-radius: 16px;
  background: #f5f5f5;
  transition: box-shadow .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  cursor: pointer;
}

.card-img {
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: #6eee87;
}

.card-info {
  position: absolute;
  width: 100%;
  bottom: 0;
  padding: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.card-icon {
  opacity: 0;
  transform: translateX(-20%);
  width: 2em;
  height: 2em;
  transition: all .3s ease-in-out;
}

.icon {
  --size: 20px;
  width: var(--size);
  height: var(--size);
}

/*Text*/
.card-text p {
  line-height: 140%;
 /*Delete this line for multi-line text*/
  white-space: nowrap;
}

.text-title {
  font-weight: 900;
  font-size: 1.2rem;
  color: #222;
}

.text-subtitle {
  color: #333;
  font-weight: 500;
  font-size: 1rem;
}

/*Hover*/
.card:hover {
  box-shadow: 0 10px 20px 4px rgba(35, 35, 35, .1);
}

.card:hover .card-icon {
  opacity: 1;
  transform: translateX(20%);
}
نوع: card
تاریخ ایجاد: 2026/06/06
آخرین بروزرسانی: 2026/06/06