پیش‌نمایش زنده
کد HTML
<div class="button-options">
  <div class="content">
    <input type="checkbox" hidden="" id="boldInput" name="boldInput" />
    <label for="boldInput" class="label-layout">
      <b>B</b>
    </label>

    <input type="checkbox" hidden="" id="italicInput" name="italicInput" />
    <label for="italicInput" class="label-layout">
      <i>i</i>
    </label>

    <input
      type="checkbox"
      hidden=""
      id="underlineInput"
      name="underlineInput"
    />
    <label for="underlineInput" class="label-layout">
      <u>U</u>
    </label>
    <span class="title">L❤VE FRONT-END</span>
  </div>
</div>
کد CSS
.button-options .content {
  display: flex;
  align-items: center;
  justify-content: center;
  border: solid 2px #ffffff;
  border-radius: 4px;
  position: relative;
}
.button-options .content .label-layout {
  min-width: 45px;
  height: 45px;
  display: flexa;
  align-items: center;
  justify-content: center;
}
.button-options .content .label-layout :is(b, i, u) {
  display: grid;
  place-content: center;
  height: 100%;
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.button-options .content .label-layout[for="italicInput"] {
  border-left: solid 2px #ffffff;
  border-right: solid 2px #ffffff;
  min-width: 49px;
}
.button-options .content input[type="checkbox"]:checked + .label-layout {
  background-color: #ffffff60;
}
#boldInput:checked ~ .title {
  font-weight: bold;
}
#italicInput:checked ~ .title {
  font-style: italic;
}
#underlineInput:checked ~ .title {
  text-decoration: underline;
}
.button-options .title {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  position: absolute;
  bottom: 0;
  top: 2px;
  transform: translateY(100%);
  color: #ffffff;
}
نوع: button
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05