How to Create a Custom Checkbox with PURE CSS - HTML & CSS Tutorial (Web Design)

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025

ความคิดเห็น • 37

  • @ammaransari3392
    @ammaransari3392 2 ปีที่แล้ว

    This video is Gold, I've been find a tutorial as such for almost 2 days...

  • @olgabutsik6632
    @olgabutsik6632 2 ปีที่แล้ว

    Thanks. I have done it, the best video for styling checkbox i had ever seen)))

  • @TomasMisura
    @TomasMisura 5 ปีที่แล้ว +2

    Well this is what I have been looking for because I'll be using this a lot. Thanks a lot for that !!!

  • @Frankslaboratory
    @Frankslaboratory 5 ปีที่แล้ว +7

    Great video and well explained, thank you

  • @irfandz3031
    @irfandz3031 2 ปีที่แล้ว

    Thanks for very nice, clear and straightforward explanation with all the details needed!

  • @DRUEVISUAL
    @DRUEVISUAL 2 ปีที่แล้ว

    Very clear and straightforward explanation!
    Thank you!

  • @ankitkumarjat9886
    @ankitkumarjat9886 4 ปีที่แล้ว

    Great video, now checkbox is not going to be headache for me.
    Thanks man 👍

  • @rishtekhojocom
    @rishtekhojocom 9 หลายเดือนก่อน

    you are great great--------------great teacher

  • @patrickc.6183
    @patrickc.6183 3 ปีที่แล้ว

    Great video Dom!

  • @justsaybobby
    @justsaybobby ปีที่แล้ว

    any idea how we can style the label border and background when the checkbox is checked?

  • @abbyroskind9027
    @abbyroskind9027 3 ปีที่แล้ว +2

    As others have mentioned, the property display: none seems non-workable as this is a problem for screen readers and accessibility.
    Do you need to involved JS if you want to be able to actually click on the box to get the check mark? It seems like this solution only allows you to click the label to check the box.

  • @abhisheksurela2881
    @abhisheksurela2881 2 ปีที่แล้ว

    Could you please tell me which fonts are you using?

  • @qcdiamond8292
    @qcdiamond8292 5 ปีที่แล้ว

    Well made. Thanks!

  • @selamyigrem8367
    @selamyigrem8367 2 ปีที่แล้ว

    great tutorial @dcode. i have a question tho, ---- if the background of the parent element (in this case, the label) isNOT white, the white check mark stays in place without us clicking it ------- is there anyway to get around that? tnx!

    • @samaybhattacharyya1118
      @samaybhattacharyya1118 2 ปีที่แล้ว

      Ig its too late to answer but you can try 'transparent' instead of white. Like: `color: transparent;` instead of `color: #fff;`

  • @yufangchiu3813
    @yufangchiu3813 2 ปีที่แล้ว

    for who can't use \2714:
    you can try make your own checkmark
    content: "";
    position: absolute;
    width: 5px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    top: 40%;
    left: 3%;
    transform: translate(-50%, -50%) rotateZ(40deg);

  • @perfectionchizuruoke6207
    @perfectionchizuruoke6207 2 ปีที่แล้ว

    Why should the input tag be placed under the label
    I got really confused fr

  • @seyahatdeneyimleri
    @seyahatdeneyimleri 3 ปีที่แล้ว

    thank you sir!

  • @bikramchettri9405
    @bikramchettri9405 5 ปีที่แล้ว +1

    Good Content

  • @drekforder2952
    @drekforder2952 3 ปีที่แล้ว

    Great video. can I just ask a quick question? what is difference between:
    element + sibling
    element ~ sibling
    ?

  • @Andy_a7
    @Andy_a7 4 ปีที่แล้ว

    Thank you for the video! Just wondering, is inline element, right? How come we can turn inline (non-block) element into a flex container? Or any Html tag can be a flex container?

  • @riyazahamed9208
    @riyazahamed9208 3 ปีที่แล้ว

    Unicode is not working
    Could you please help

  • @emAyush56
    @emAyush56 3 ปีที่แล้ว

    We cannot have a div element inside a label. It's a HTML validation error. Can use 'span' or 'a' element, instead.
    Neat design otherwise.

  • @ibrahimahmad1019
    @ibrahimahmad1019 4 ปีที่แล้ว

    thanxxxxx bro

  • @thiagoSilva346plus
    @thiagoSilva346plus 4 ปีที่แล้ว

    God, you are a god!

  • @abeprangishvili
    @abeprangishvili 5 ปีที่แล้ว +1

    good !!!

  • @gedoumazoutsuki
    @gedoumazoutsuki 2 ปีที่แล้ว

    holy f*** the fact that you have to go and to so much stuff just to have a checkbox look the way you want blows my mind...i'd rather go on and create my own with js or if there is no js in the project(wich is unlikely) i'de rather leave the stock one. its not to diss you video, its cool. just the fact that html didn't get a solution for this is horrible..it's just an input...give us control over it😑

  • @syediqbalahmed3176
    @syediqbalahmed3176 5 ปีที่แล้ว

    valo

  • @Varkatel
    @Varkatel 4 ปีที่แล้ว

    display:none
    are you kidding me?
    it worse solution ever

    • @ms77grz
      @ms77grz 3 ปีที่แล้ว

      Yeah, you're right:
      opacity: 0;
      width: 0;
      margin: 0;
      What about this?

    • @nizaraitmoussa9266
      @nizaraitmoussa9266 3 ปีที่แล้ว

      no and yes and no