Custom select menu - CSS only

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 193

  • @kenny123451
    @kenny123451 4 роки тому +62

    Thank you!
    pointer-events:none; Is a lifesaver!
    In my current project, I started to write Js to make stuff at the background clickable.... :D You saved me a lot of hours!

  • @RANKKY9
    @RANKKY9 4 роки тому +98

    Kevin: pointer-events: none;
    Me: 🤯🤯🤯

  • @TomAinsworth94
    @TomAinsworth94 Рік тому +1

    I’ve struggling to get something like this together at work today, and your video is perfect to get me started! Thanks as always Kevin

  • @s.fofandi
    @s.fofandi 4 роки тому +1

    I did a similar custom select input on one of my project another thing you can do when doing something like this is have an SVG with your up and down arrows and use that as the background of the select element. then with repeat: none, position: right, and size: 100% auto, you can place it to the right. this prevents you from having multiple classes and an extra dom element for an effect like that. that being said OBVIOUSLY there are 1001 ways of doing whatever you want in CSS (that pointer-events thing was brilliant)

  • @mrabhijitrabha
    @mrabhijitrabha Рік тому +1

    pointer-event: none; made my day, thank you master ❤️

  • @bijayaadhikari442
    @bijayaadhikari442 4 роки тому +1

    Scrimba is great, not just to learn, practice every moment.

  • @andriilukianenko8106
    @andriilukianenko8106 2 роки тому +2

    I don't think I will ever be able to fully comprehend CSS, but Kevin's content makes me feel I know some tips and hacks :D

  • @mostafagh3573
    @mostafagh3573 Рік тому

    you saved my day and my mental health in one move, god bless you .

  • @ThiagoVieira91
    @ThiagoVieira91 4 роки тому +27

    Me: "WTF!? How I'm going to build this context tooltip? The icon is messing everything!"
    Kevin: pointer-events: none;
    Me: 🤯

  • @md.mirazuddin364
    @md.mirazuddin364 3 роки тому

    Thanks again for making such incredible video.
    pointer-events: none. that was a life saver.

  • @abnerwillys
    @abnerwillys 4 роки тому +1

    Amazing video man. I'm a Dev jr on stack JS, and this video helps very much. Thanks and best regards from Brazil.

  • @yitzchaksviridyuk932
    @yitzchaksviridyuk932 3 роки тому

    Appreciate your content so much that I don't skip a lot of the ads on your videos. 😄

  • @khalilmahmoodiyan975
    @khalilmahmoodiyan975 Рік тому

    Awesome. I was looking for this for many days

  • @kiliusz
    @kiliusz 4 роки тому

    pointer-events: none
    Very nice tip.

  • @AjayKumar-pn5yy
    @AjayKumar-pn5yy 2 роки тому

    You are awesome Kevin ❤️❤️❤️

  • @MikeyRussell88
    @MikeyRussell88 4 роки тому +6

    It's a real shame that even today css doesn't provide ways to style these elements. For security I can understand they cannot be fully customisable but the basics like colours borders arrow styles should be available to the user without needing hacks. Maybe in CSS 4 eh?

  • @MohammadAbdulHyeShaon
    @MohammadAbdulHyeShaon 4 роки тому +5

    Excellent...Go Ahead my dear....

  • @Avinash.i1Brand
    @Avinash.i1Brand Рік тому

    You saved my time by pointer events property. Thank you Kevin. Much love 💕

  • @zvelkimD
    @zvelkimD 4 роки тому

    Super! Always nice to see even experts have trouble with top and translate properties :D

  • @arsaurabh6044
    @arsaurabh6044 2 роки тому +1

    This was a cool video. Learned a lot. And that border trick was pretty neat.

  • @Markor91
    @Markor91 2 роки тому

    It works like a charm, thank you!

  • @bishwajitsarkar8873
    @bishwajitsarkar8873 Рік тому

    it's a real helpful.Thank you sir, for the tutorial.

  • @pablowbk
    @pablowbk 4 роки тому +3

    I came for the tshirt, stayed for the content 😎

  • @captaindesign
    @captaindesign 4 роки тому +1

    Excellent tutorial, thanks Kevin!

  • @manosmenexis3160
    @manosmenexis3160 4 роки тому +3

    You could use a transformX for the arrows and then add top to the ::before and bottom to the ::after. That way it would be the same number.

  • @bahaajasim3793
    @bahaajasim3793 2 роки тому

    Thank you Kevin

  • @seathwolf5610
    @seathwolf5610 4 роки тому

    You are the best teacher!!!! Thank you for all your videos.

  • @mke7605
    @mke7605 4 роки тому +4

    On firefox this doesn't seem to behave. Setting the color for the select results in Firefox on my machine in in a nicely colored object, but the option list is still white. On Chrome it behaves like expected though.

  • @nickwoodward819
    @nickwoodward819 3 роки тому

    The differences, afaik, between inline-block and block, is that for the former you're using inline-block instead of flex, and for the latter you're using block instead of flex
    HTH :)

  • @arseneawounou180
    @arseneawounou180 4 роки тому

    Maybe you dunno but you're doing a great job and teaching a lotta people in the world! Thanks! ✨

  • @abdiasmigaud2647
    @abdiasmigaud2647 2 роки тому

    Thank you very much for this video.

  • @viktorbublic
    @viktorbublic 4 роки тому +4

    This is great. Thank you.

  • @abdulrahmannasser1079
    @abdulrahmannasser1079 3 роки тому

    My opinion is to replace these custom icons to arrow up icon from font-awesome

  • @chrisj.2611
    @chrisj.2611 4 роки тому +4

    Quite a nice trick. But personally i would use font awesome for example for the arrow (unless you dont want to use any outside stylesheet). But this gets rid of the before and after pseudo element.

  • @miracleio8555
    @miracleio8555 4 роки тому

    Another Awesome trick, Thank you Kevin!

  • @elcolo77
    @elcolo77 2 роки тому

    Wow, nice and usefull video!!! Thanks for everyday's rising learning curve!

  • @glenn4140
    @glenn4140 3 роки тому

    Thank you Kevin. You are so helpful!

  • @giorgimindiashvili3810
    @giorgimindiashvili3810 2 роки тому

    i love u man i love u always when i watching your videos i always found something new bravo

  • @mdyousufgazi4030
    @mdyousufgazi4030 4 роки тому +1

    awesome video! loved it

  • @nonchalant8473
    @nonchalant8473 4 роки тому +1

    Great tutorial! Thanks

  • @c__beck
    @c__beck 4 роки тому +2

    You have the best shirts, Kevin!

    • @KevinPowell
      @KevinPowell  4 роки тому +2

      Thanks, this is def. one of my favourites :)

    • @BloodyClash
      @BloodyClash 4 роки тому

      oooh. just noticed...is that a zelda shirt ?

    • @c__beck
      @c__beck 4 роки тому

      @@BloodyClash it is!

    • @BloodyClash
      @BloodyClash 4 роки тому +1

      @@c__beck Cool. I love Zelda Stuff (maybe not the biggest fan in the world but still love it)

  • @elvingonzalez8932
    @elvingonzalez8932 7 місяців тому +2

    Please. how to change the blue background hover option??

  • @MsElsospechoso28
    @MsElsospechoso28 4 роки тому +1

    looking good on that zelda shirt

  • @DavidAshby1
    @DavidAshby1 3 роки тому +7

    Hi Kevin, thanks for another great tutorial. I have one question though. When I put the dropdown in a container that spans the full width of the screen the custom arrow moves to the far right of the screen so I have ended up creating another container within to hold the dropdown which keeps the elements together (although we have done positioning relative and absolute). Shouldn't the position: absolute; on the custom arrow keep its position no matter the width of the viewport ?

    • @_Valentin
      @_Valentin 2 роки тому

      I have the same problem and i dont understand how to fix it :(

  • @vojislavdjuric8856
    @vojislavdjuric8856 9 місяців тому

    Nice. Thank you.

  • @ChillCityNaveen
    @ChillCityNaveen 4 роки тому

    Awesome trick to create triangles thanks kevin:)

  • @newentu
    @newentu Рік тому

    Excelente tutorial!

  • @lucass.p9579
    @lucass.p9579 4 роки тому +4

    Great video. I'll do something like that in one of my project, because these difference between the browsers inputs/selects is annoying. And btw now Chrome has a super weird black outline on any type of focus.

    • @adao5308
      @adao5308 3 роки тому

      Try using :focus {outline:none} on the property if you're still having that problem.

  • @m2kdevelopments
    @m2kdevelopments 3 роки тому

    Awesome video

  • @segsfault
    @segsfault 3 роки тому +1

    Kevin: pointer-events: none;
    Me: What De Fok 🤯

  • @waelmoh
    @waelmoh 4 роки тому

    pointer event, I didn't know anything about this before :D ThanQ

  • @mattmarkus4868
    @mattmarkus4868 2 роки тому +1

    Great video, but how do you change the blue hover highlight color on the options? Chrome is blue, Edge is dark grey, etc. Is that possible?

  • @rayansh1245
    @rayansh1245 2 роки тому

    thank you sir

  • @shulehr
    @shulehr 2 роки тому

    very good tutorial

  • @zlackbiro
    @zlackbiro 4 роки тому

    i am more happy about pointer-events:none; I am very good in css, but i didnt know that... not shamed... :) We learning every day and css is more harder then Java, i think! :D

  • @AmirulIslam-gg2fn
    @AmirulIslam-gg2fn 4 роки тому

    Awesome!

  • @MyDistortedWorld
    @MyDistortedWorld 4 роки тому

    Nice Kevin! Thanks man 👍

  • @0the0ambient0
    @0the0ambient0 4 роки тому

    Thanks for another great tutorial.

  • @j0ca1995
    @j0ca1995 4 роки тому

    Great video!

  • @nikolavemic5216
    @nikolavemic5216 Рік тому

    Great !!

  • @j.almadhaji
    @j.almadhaji 4 роки тому +2

    I enjoy watching you ❤

  • @LukeDorny
    @LukeDorny 4 роки тому +1

    Could you make video with a couple of uses for clip path? Thanks, Kevin!

  • @gethermedel3620
    @gethermedel3620 4 роки тому

    I knew this 5 years ago. it's nice you are teaching this to others :D keep it up!

  • @adao5308
    @adao5308 3 роки тому

    Wow... Thanks!

  • @JamesWelbes
    @JamesWelbes 4 роки тому

    I prefer the per class model because when you subscribe, if you stop paying you lose access to everything. When you buy a class you get it forever

  • @deniskotov
    @deniskotov 3 роки тому

    Nice!

  • @mattwood8659
    @mattwood8659 4 роки тому +1

    I was excited to see this at first. I really wanted a more consistent width for the options across the browsers but I'm a little disappointed you didn't do that. Is it possible at all to style the select options?

  • @iUmerFarooq
    @iUmerFarooq 4 роки тому

    That's amazing. ❣

  • @Sisier
    @Sisier 4 роки тому

    Nice video !!!
    very useful

  • @johnmclane9851
    @johnmclane9851 4 роки тому +2

    Thank you for awsome videos.
    I would love to watch your live stream, but unfortunately my timingd don't match with schedule of live stream.
    Please make sure to upload stream afterwards.

  • @nickwoodward819
    @nickwoodward819 3 роки тому +1

    Love this, but out of interest, do you know of a good source on how to make a completely custom select element?

  • @АнтонФомичев-щ2ю

    MDN
    Permitted content for :
    Zero or more or elements.
    So, could not be nested with the element

  • @medhatadolf0
    @medhatadolf0 2 роки тому

    Thank you :)

  • @peetboy
    @peetboy 4 роки тому

    Worth mentioning that *appearance* css property is experimental, not fully supported by all browsers.

  • @fozilbekmuhammedjonov9518
    @fozilbekmuhammedjonov9518 2 роки тому

    Thanks that's cool ☺️

  • @presidiun
    @presidiun 3 роки тому +1

    very nice. I have a question how do you style the drop down menu so that it moves slightly up?

  • @ralphmartynsamaniego7017
    @ralphmartynsamaniego7017 4 роки тому

    Do another one for Radio and Check boxes as well! :D
    Great video btw!

  • @KlaudiusL
    @KlaudiusL 4 роки тому

    @15:28 ... my daily css programing

  • @shaunbowen
    @shaunbowen 4 роки тому

    For the vertical positioning of the triangles, wouldn't it be better to use something like top: calc(50% - 0.2em) and bottom: calc(50% - 0.2em) respectively? Then you can adjust the triangle size and always have them spaced 0.4em apart in the centre?

  • @ajmaljoiya6006
    @ajmaljoiya6006 3 роки тому

    Great

  • @bhalchandragaikwad1605
    @bhalchandragaikwad1605 4 роки тому +1

    hi, i understood who to customize "select" things. BUT i want to change background color and selection color of "option" things. how to do this? please explain

    • @GSYSYT
      @GSYSYT 4 роки тому

      You don't. It's not possible to style options in a good way. You need custom markup and JS for that.

  • @Endrit719
    @Endrit719 3 роки тому

    wtf, I never knew pointer events none will allow you to click the element behind :'(, I've had to find workarounds so many times to avoid that problem :O

  • @marc_joan
    @marc_joan 4 роки тому

    Hey Kevin, thanks for that tutorial, but... What about multiple select? I find them so tricky to customize!

  • @maneeshrockx667
    @maneeshrockx667 4 роки тому

    Thankyou , I learned something interesting 😍.. can I know what theme are you using in vs code?.

  • @tonimaunde
    @tonimaunde 4 роки тому

    Cool.

  • @pawejurgielewicz7892
    @pawejurgielewicz7892 4 роки тому

    Geat video as always! I just have a little question: how can you use Firefox and Chrome simultaneously via Live Server in VScode?

    • @migueldomingos4570
      @migueldomingos4570 4 роки тому +1

      It works automatically in that way since it is running on a port on your localhost. You just have to go to localhost:5500 on both firefox and google

  • @zero758
    @zero758 4 роки тому

    Nice shirt!

  • @ataulhasan1894
    @ataulhasan1894 4 роки тому +1

    wow this is helpfull

  • @vladislav.c
    @vladislav.c 3 роки тому

    Thanks a lot.
    And i have a question. Is there any way customize select using just css, but instead of text in option use images. Or use text and images in option.

  • @mohan9285
    @mohan9285 4 роки тому

    Pretty cool and interesting :)

  • @anuj7286
    @anuj7286 4 роки тому

    Sir thankyou so much, can you please make a video on how to style checkbox in bootstrap?

  • @anamazanova
    @anamazanova 3 роки тому

    Hey Kevin, any advice on how to change the placeholder color for this element??

  • @rogerpence
    @rogerpence 4 роки тому

    Things get whacky if you remove the top-level display:grid and center-items. Don't you need to set a width on the .custom-select element? Overall, though, the technique is superb! Great job.

    • @KevinPowell
      @KevinPowell  4 роки тому +1

      Ah, yeah. I just set it up as a quick example and didn't think of that. Setting a width on it might help things out when we put it in context.

    • @rogerpence
      @rogerpence 4 роки тому +1

      @@KevinPowell That was a minor glitch it what is otherwise a great technique. I love how simple and direct the technique is. Your videos are always great, Kevin. Thank you!

  • @benjaminhammond7925
    @benjaminhammond7925 4 роки тому

    Have you found a way to change the select's options background color???

  • @kdfksfkldsklfkldsff
    @kdfksfkldsklfkldsff 4 роки тому

    damn very helpful man!!

  • @azhardanii
    @azhardanii 2 роки тому

    amaziinggg sir, but any method to change hover color on selection option items? its soo difficult for mee, pleaseee helpp 🙏😭

  • @cintron3d
    @cintron3d 4 роки тому +1

    Gotta be honest, that title was a little misleading. I was looking forward to learning of some secret to styling options in a select but it stopped there. This video is really more about Scrimba and pointer events: none . It's not a bad look but still not truly custom enough so I'll be sticking with my bootstrap/custom select implementation.

  • @hcsftw
    @hcsftw 4 роки тому

    Hi Kevin, could you put this Demo into a Codepen? I am a bit too lazy to retype it, but I would love to experiment with it!

  • @neo4now
    @neo4now 4 роки тому

    Hi Kevin! would you consider break down and show how can you accoplishe gradian animation at the top of this page 'stripe.com' because for the love of god I just can not figure it out. (I know you have a video on some gradien animation but this once seams totaly diffrent). take care:)

  • @mr.mikaeel6264
    @mr.mikaeel6264 4 роки тому

    Zelda shirt! There you have it, alrdy thought u are a nice guy. Now u just moved up in rank alot ^^