အသုံးပြ� ခြင်း

CSS ဖြင့် ဖွဲ့စည်းပုံ စကားလုံး နှင့် အသုံးပြု သင်ကြားပါ

ပုံစံ

အသုံးပြု
အသုံးပြု

အသုံးပြု
အသုံးပြု

ဖွဲ့စည်းပုံ စကားလုံး အသုံးပြု

ဖွဲ့စည်းပုံ စကားလုံး အသုံးပြု

亲自试一试

ဖွဲ့စည်းပုံ စကားလုံး အသုံးပြုခြင်း

ပထမ အပိုင်း - စကားလုံး ပြုပြင်ပြသ HTML:

<label class="container">အသုံးပြု
  <input type="checkbox" checked="checked">
  <span class="checkmark"></span>
</label>
<label class="container">အသုံးပြု
  <input type="checkbox">
  <span class="checkmark"></span>
</label>
<label class="container">အသုံးပြု
  <input type="checkbox">
  <span class="checkmark"></span>
</label>
<label class="container">အသုံးပြု
  <input type="checkbox">
  <span class="checkmark"></span>
</label>

ဒုတိယ အပိုင်း - စကားလုံး ပြုပြင်ပြသ CSS:

/* အသုံးပြုသော အချက်အလက်(အကွက်) */
.container {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* လိုက်န်းကျင်း ဖွဲ့စည်းပုံ စကားလုံး ဖုံးကွယ် */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
/* ဖွဲ့စည်းပုံ စကားလုံး ဖွဲ့စည်း */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
}
/* အသုံးပြုသော စက်သုံးပတ်လုံးတင်ခြင်း အရွေ့အထိပ် အရွေ့အထိပ် အော်တန်း ပြောင်း */
.container:hover input ~ .checkmark {
  background-color: #ccc;
}
/* ဖွဲ့စည်းပုံ စကားလုံး ရှိပါက အမှတ်အသား အရ အဝါရောင် နောက်ခံ ပြုပြင် */
.container input:checked ~ .checkmark {
  background-color: #2196F3;
}
/* ဖွဲ့စည်းပုံ စကားလုံး ဖွဲ့စည်းပြီး လိုက်န်းကျင်း မဟုတ်ဘဲ ကို ဖုံးကွယ် */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}
/* ရှိပါက ဖွဲ့စည်းပုံ စကားလုံ� ပြုပြင်ပြသ */
.container input:checked ~ .checkmark:after {
  display: block;
}
/* ဖွဲ့စည်းပုံ စကားလုံး နှင့် အမှတ်အသား အဆိုအရ */
.container .checkmark:after {
  left: 9px;
  top: 5px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

亲自试一试

သတ်မှတ်ရာရွက်စင်းအော်တန်း(နှစ်/ကြား) ဖန်တီးခြင်း ဘယ်လိုဖြစ်သလဲ

အကြိမ်

/* အသုံးပြုသော အချက်အလက်(အကွက်) */
.container {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* ဘရောက်သုံးချက်အရွေ့အထိပ် ပိတ်ခြင်း */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
/* သတ်မှတ်ရာရွက်စင်းအော်တန်း(နှစ်/ကြား) ဖန်တီးခြင်း */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
  border-radius: 50%;
}
/* အသုံးပြုသော စက်သုံးပတ်လုံးတင်ခြင်း အရွေ့အထိပ် အရွေ့အထိပ် အော်တန်း ပြောင်း */
.container:hover input ~ .checkmark {
  background-color: #ccc;
}
/* အသုံးပြုသော စက်သုံးပတ်လုံးတင်ခြင်း အရွေ့အထိပ် အရွေ့အထိပ် အော်တန်း ပြောင်း */
.container input:checked ~ .checkmark {
  background-color: #2196F3;
}
/* ရွက်စင်းအော်တန်း(နှစ်/ကြား) ဖန်တီးခြင်း(နှစ်/ကြား - ရွေးချယ်ခဲ့သည်မဟုတ်ဘဲ ကွဲပြောင်း) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}
/* ရွေးချယ်ခဲ့ပါက ရွက်စင်းအော်တန်း(နှစ်/ကြား) ပြပြောင်း */
.container input:checked ~ .checkmark:after {
  display: block;
}
/* သတ်မှတ်ရာရွက်စင်းပုံအော်တန်း(နှစ်/ကြား) */
.container .checkmark:after {
  top: 9px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

亲自试一试