Stop using pixels in your CSS! How and why to use REM and EM.

Поделиться
HTML-код
  • Опубликовано: 15 сен 2021
  • Pixels are problematic when it comes to accessibility on the web. In this video, we talk about pixels and what happens when accessibility tools are turned on, and I provide you with an alternative option.
    .
    .
    .
    .
    .
    Music from Uppbeat (free for Creators!):
    uppbeat.io/t/sonda/were-in-it...
    License code: QEOATAWHSOBYILVT
  • НаукаНаука

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

  • @2slimj
    @2slimj 2 года назад +14

    Wow. Most tutorials just say REMs and EMs are better practices without any explanation. But you showed the why. Thanks alot

  • @hypothalamussounds7962
    @hypothalamussounds7962 25 дней назад

    Thanks for this video, i was stuck in my learning due to this concept of em and rem and px, but you made just the right video as to why use them instead of px, i recommend this to other programmers.

  • @Pod28
    @Pod28 Год назад

    Great simple example, thank you!

  • @gavinbevan365
    @gavinbevan365 4 месяца назад

    Really good explanation, thanks for posting!

  • @MrVishalGaikwad
    @MrVishalGaikwad Год назад +1

    Thanks for this. Cleared many doubts for me. Simple & Effective explanation.

  • @mostafagh3573
    @mostafagh3573 Год назад

    wow, thank you so much. great video!

  • @bibekdhkl
    @bibekdhkl 2 года назад +1

    Thank you, after about 2 years, Finally I understood it fully :)

  • @bruhmoment3731
    @bruhmoment3731 Год назад

    Thank you! This is great!

  • @user-xy1zw2dn9i
    @user-xy1zw2dn9i 11 месяцев назад

    Your video was truly helpful and gave me a better understanding of rem's role. If possible, could you please share more practical examples? Thank you in advance.

  • @haroldguzman1285
    @haroldguzman1285 3 месяца назад

    Thank you very helpful 😉.

  • @dcts7526
    @dcts7526 9 месяцев назад +1

    So we are just gonna ignore how the "Hi there!" suddenly flew out of that container? How to solve this?

  • @DavidChijioke-hc8ub
    @DavidChijioke-hc8ub 11 дней назад

    very precise

  • @MrAjayz
    @MrAjayz 2 года назад

    Great work on your video

  • @mohamedsalimbensalem6118
    @mohamedsalimbensalem6118 Год назад

    thank you so much now i know why my website sucks when i zoom out for more then 100%

  • @Ioremipsumdolorsitamet
    @Ioremipsumdolorsitamet Год назад

    thank you :)

  • @oseniadedoyin1044
    @oseniadedoyin1044 2 года назад

    Great content ...

  • @user-nh5cj2uq7o
    @user-nh5cj2uq7o Год назад

    شكرا كان الشرح مفيدا

  • @ricardojosino
    @ricardojosino Год назад +1

    I did some tests using REM, but I didn't like the idea of the layout changing without any control. When changing the Chrome font to full size, the layout grew so much that it didn't fit the screen. So far, I've only seen it work on examples on youtube, but in practice, I came to the conclusion that it doesn't work well in a real layout. Perhaps it should work in an app layout that is more minimalistic. But I will continue studying, see you later!

    • @IanLenehan
      @IanLenehan  Год назад

      I think it's probably best suited to font sizes and then layouts that affect the font spacing! But yeah each use case would be different I guess :-)

    • @delveticas
      @delveticas Год назад

      agreed, if the website is made with proper font size there would be no need to use zoom in the first place.

  • @OneBrokeBloke
    @OneBrokeBloke 3 месяца назад

    I get it for fonts, but for stuff like the containers/boxes in the video, wont we encounter issues like this potentially?
    I just cannot imagine it being maintainable/scaleable, that these boxes now have REM and will start colliding with eachother, as soon as the user starts increasing the font size?

  • @juannpablo4322
    @juannpablo4322 Год назад +1

    Nice content thank you ! Should we use rem for margin and padding too ? I’ve seen websites doing this

    • @IanLenehan
      @IanLenehan  Год назад +1

      I guess it kind of depends on how everything is laid out. You might be able to just use pixels but you can decide what to use when building something and see how it works.

    • @juannpablo4322
      @juannpablo4322 Год назад

      @@IanLenehan yes thank you !

    • @thexpand
      @thexpand Год назад +1

      Margins and paddings are better in EM rather than REM. Think of buttons, for example - their paddings should change based on the font size of their content, hence the EM.

  • @Anonym12351
    @Anonym12351 Год назад

    How are you able to type and use the curly brackets on a mac?
    I have the new macbook air and cant even use them...
    Thanks.

    • @IanLenehan
      @IanLenehan  Год назад

      Hey, I'm not sure what you mean. You can't see them on your keyboard?

  • @reynandelizo1480
    @reynandelizo1480 Год назад

    I have a question about media queries max-width why we need to use em instead of px?

    • @IanLenehan
      @IanLenehan  Год назад

      For media queries I would say pixels make more sense here

  • @shahidullahmuffakir668
    @shahidullahmuffakir668 Год назад

    Oh man you deserve millions subscriber❤

  • @igu642
    @igu642 9 месяцев назад

    ❤❤

  • @JP-gg2gk
    @JP-gg2gk Год назад

    Dude , one doubt... can i use rem in all cases that we use px ?

    • @IanLenehan
      @IanLenehan  Год назад

      Hey JP - I would say no, it doesn't apply everywhere. Sometimes you need the fixed values of pixels. I think if you're unsure of where to use it, play around with your site and with the zoom and see what looks off and what doesn't.

  • @VadimCool
    @VadimCool Год назад +1

    The title of this video suggests to stop using pixels. Is that a click-bait? It's like saying to people to stop eating oranges and stick to eating apples. There is a reason why pixels exist. And what has been shown in this video would not provide a desirable outcome on certain platforms where consistency is key. So in this case I could say that if you want to lose total control of your design, then use REM or EM. But if you want to stay in control of it as a developer and not as a user, then use PX. Users often times don't know how to properly use a website and stay in control of it. So therefore it is the job of the developer to make sure that everything is where it is suppose to be and not jumping all over the place as they see it fit. 🙂

    • @IanLenehan
      @IanLenehan  Год назад

      You may have misunderstood the message in the video, but all good. I appreciate your opinion!

  • @pedrosilva4342
    @pedrosilva4342 3 месяца назад

    so use rems, aight thanks

  • @hanac5586
    @hanac5586 Год назад

    Amazing explanation! This cleared things up a lot. Thank you so much 🫂