I Love This CSS Focus Hack

Поделиться
HTML-код
  • Опубликовано: 6 июн 2024
  • The CSS :focus state is simple on the surface, but there is actually quite a lot going on behind the scenes. There are 3 total :focus states you can use in CSS and even a secret fourth state that make :focus much more complicated than it may first appear. In this video I go over everything you need to know about CSS :focus states.
    📚 Materials/References:
    CSS :has Selector Video: • This Is So Much More T...
    CSS :has Selector Article: blog.webdevsimplified.com/202...
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    ⏱️ Timestamps:
    00:00 - Introduction
    00:29 - :focus
    01:16 - :focus-visible
    03:05 - :focus-within
    04:19 - :focus-visible-within
    05:38 - Use Cases
    #CSSFocus #WDS #CSS

Комментарии • 35

  • @LePhenixGD
    @LePhenixGD Месяц назад +5

    The :has pseudo-class really makes CSS easier

  • @lexidugo
    @lexidugo Месяц назад +3

    This came at just the right time !!! Thanks so much

  • @saqibkhanz8417
    @saqibkhanz8417 Месяц назад +9

    Waiting for your lengthy project-based videos.

  • @aer0449
    @aer0449 Месяц назад +2

    Kyle, bro I took your CSS course and I loved it .... Anyone looking to drastically improve on CSS do buy his course, its short and to the point .... I am so thankful to you brother ... Amazing work ❤

  • @specializer222
    @specializer222 Месяц назад +9

    I love this short videos about functions in CSS 😍

  • @bharathnaidu4636
    @bharathnaidu4636 Месяц назад

    you always rocks thanks for the content

  • @akoladebode-ajayi327
    @akoladebode-ajayi327 Месяц назад +2

    Thank you sir 😊

  • @dragenn
    @dragenn Месяц назад

    This is invaluable!

  • @WebDevelopmentWithSS
    @WebDevelopmentWithSS Месяц назад +1

    This video is amazing.

  • @imnikki00
    @imnikki00 Месяц назад +1

    awwwwwwwwwwww thank you ! Im great fan of yours sir

  • @user-ko1cw6mv4q
    @user-ko1cw6mv4q Месяц назад

    ❣️ great video

  • @akramilyas6030
    @akramilyas6030 Месяц назад

    thanks for all

  • @Frexuz
    @Frexuz Месяц назад

    Is the has(focus-visible) doable in tailwind?
    PS: When you tabbed between the inputs back and forth, as a color-impaired person, I basically didn't see any change between "black" and "red" (and the input cursor is incredibly thin). Please use "blue" in the future :))

  • @rayyanabdulwajid7681
    @rayyanabdulwajid7681 Месяц назад

    I have made a click drop-down using css only using css "focus outside". When i click outside the drop-down, the drop-down closes. This was not possible when we were using css checkbox approach

  • @ajiteshmishra0005
    @ajiteshmishra0005 Месяц назад

    What is the difference of using in header and body.

  • @alexkuehne86
    @alexkuehne86 Месяц назад

    That means :focus-within could also be replaced with :has(:focus)?

  • @abdullaahmad5503
    @abdullaahmad5503 Месяц назад

    Video on vh and dvh please

  • @ArielFerro
    @ArielFerro Месяц назад +1

    Wow! I had no idea about those CSS selectors for controlling focus. This could spark a really interesting discussion about the accessibility advantages of each approach. But I definitely want to thank you for addressing such a crucial issue for people with low vision by presenting alternative techniques to the traditional ones. Kudos to you!

  • @rishiraj2548
    @rishiraj2548 Месяц назад +1

    🙂👍🎉

  • @sushantchoudhary07
    @sushantchoudhary07 Месяц назад +1

    first 🥇

  • @neimado
    @neimado Месяц назад +18

    Please calm down the head shaking while you talk, it's kind of distracting.

    • @jelilabudu
      @jelilabudu Месяц назад +7

      I get your frustration. However, the most important thing you need is to pay attention to is the message.
      I often watch people with fast speech, native accents, etc, which makes it difficult for me to grasp at once, what they're trying to put across. So, I either lower the speed or, I replay any section part that I don't not understand.

    • @YO-BIZZY
      @YO-BIZZY Месяц назад +9

      That’s the best part tf

    • @MrHellmager
      @MrHellmager Месяц назад +19

      People will really hate no matter what huh 😅

    • @neimado
      @neimado Месяц назад +6

      @@MrHellmager It's not called "hate", it's called *constructive criticism*. Imagine thinking the only way to communicate is either praise or "hate".

    • @rs832
      @rs832 Месяц назад +13

      That's a weird way to say "thank you for the very helpful free content!"

  • @ezwtwrziehag1736
    @ezwtwrziehag1736 Месяц назад +1

    this isnt secret, people know this long ago