پیش‌نمایش زنده
کد HTML
<div class="card">
  <div class="text-content">
    <p class="card-heading">Privacy Policy is currently undefined.</p>
    <p class="card-content">
      Every website must include a link to a detailed privacy policy.
    </p>
    <a href="#" class="card-link">Understand why?</a>
    <button class="exit-btn">
      <svg fill="none" viewBox="0 0 15 15" height="15" width="15">
        <path
          stroke-linecap="round"
          stroke-width="2"
          stroke="black"
          d="M1 14L14 1"
        ></path>
        <path
          stroke-linecap="round"
          stroke-width="2"
          stroke="black"
          d="M1 1L14 14"
        ></path>
      </svg>
    </button>
  </div>
</div>
کد CSS
.card {
  width: 320px;
  height: fit-content;
  background: #fff0d1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.text-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 15px 18px;
  gap: 3px;
}
.card-heading {
  font-size: 1em;
  font-weight: 800;
}
.card-content {
  font-size: 0.95em;
  font-weight: 500;
  color: rgb(49, 49, 49);
}
.card-link {
  color: black;
  font-weight: 600;
  margin-top: 5px;
}
.exit-btn {
  position: absolute;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  right: 8px;
  top: 8px;
  cursor: pointer;
}
.exit-btn svg {
  width: 12px;
}
.exit-btn:hover {
  background-color: #eadaba;
}
.card::before {
  content: "";
  background-color: #ffb700;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: -1;
  padding: 4px;

  transition: all 0.3s;
}
.card:hover::before {
  margin: 25px 0 0 25px;
}
نوع: card
تاریخ ایجاد: 2026/06/06
آخرین بروزرسانی: 2026/06/06