پیش‌نمایش زنده
کد HTML
<div class="main-container">
  <div class="quiz-card">
    <div class="card-header">
      QUESTION <span class="question-number">01</span>
    </div>

    <div class="question-body">
      <p class="question-text">Which property creates this slant?</p>
    </div>

    <div class="options-container">
      <div class="option" tabindex="0">
        <span class="label">A</span>
        <div class="option-text">Clip-path</div>
      </div>
      <div class="option" tabindex="0">
        <span class="label">B</span>
        <div class="option-text">SkewX</div>
      </div>
      <div class="option" tabindex="0">
        <span class="label">C</span>
        <div class="option-text">Flexbox</div>
      </div>
      <div class="option" tabindex="0">
        <span class="label">D</span>
        <div class="option-text">Grid</div>
      </div>
    </div>
  </div>
</div>
کد CSS
.main-container {
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.quiz-card {
  width: 480px; /* 75% of 640px */
  background: white;
  border: 3.5px solid #2d3436;
  box-shadow: 15px 15px 0px rgba(0, 0, 0, 0.1);
  font-family: "Segoe UI", sans-serif;
  overflow: hidden;
}

.card-header {
  background-color: #2d3436;
  padding: 15px 22px;
  font-size: 18px;
  font-weight: 900;
  color: #95afc0;
  letter-spacing: 1.5px;
}

.question-number {
  color: #a55eea;
}

.question-body {
  min-height: 135px; /* Scaled height */
  padding: 22px;
  font-size: 18px;
  color: #2d3436;
  border-bottom: 3.5px solid #2d3436;
}

/* Options Styling */
.option {
  display: flex;
  height: 60px; /* Scaled from 80px */
  border-bottom: 3.5px solid #2d3436;
  align-items: center;
  cursor: pointer;
  background-color: white;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
}

.option:last-child {
  border-bottom: none;
}

.label {
  background-color: #a55eea;
  color: white;
  width: 82px; /* Scaled from 110px */
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 20px;
  font-size: 22px;
  font-weight: bold;
  clip-path: polygon(0 0, 100% 0, 75% 100%, 0% 100%);
  transition: width 0.3s ease;
}

.option-text {
  flex: 1;
  padding-left: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3436;
}

/* --- INTERACTION: 75% Scale Expansion --- */

.option:hover,
.option:focus {
  height: 90px; /* Expanded height at 75% scale */
  background-color: #fcfcfc;
}

.option:focus .label,
.option:hover .label {
  width: 105px;
  background-color: #8e44ad;
}

.option:focus .option-text,
.option:hover .option-text {
  font-size: 18px;
}
نوع: form
تاریخ ایجاد: 2026/06/06
آخرین بروزرسانی: 2026/06/06