CSS Units of Measurement [rem, em, vw, vh, px, %]

Sdílet
Vložit
  • čas přidán 11. 07. 2024
  • There are about 15 CSS units of measurement compatible with most browsers. We are going to cover all of the ones that you will use in real life. We'll cover absolute units like pixels (px) and relative units like percent (%), viewport width (vw), viewport height (vh), and the ones that I get the most questions about, rem and em. I'll clearly explain how they work and when you should and should not use them.
    There is a CSS unit that I left out of the video, and that is fractional units (fr). These are specific to CSS Grid. I have a video on that subject that goes into detail on fr units.
    Learn CSS Grid in 20 Minutes (2019)
    • Learn CSS Grid in 20 M...
    _____________________________________
    📚 Learn to CODE in just a FEW months here:
    Treehouse Discount Code: treehouse.7eer.net/codeSTACKr
    _____________________________________
    🛠️ Tools I use:
    🟠 Theme: marketplace.visualstudio.com/...
    🟠 Font: STACKr Code (Exclusive to my VS Code Course - vsCodeHero.com)
    🟠 SuperHero Extension Pack: marketplace.visualstudio.com/...
    🚢 Deploy for FREE on Vercel: vercel.com/ambassadors/codest...
    _____________________________________
    💖 Show support!
    PayPal: paypal.me/codeSTACKr
    _____________________________________
    Watch Next:
    Web Development - Beginners Roadmap (2020) - • Web Developer Roadmap ...
    Playlist: Web Development For Beginners - • Web Development - Begi...
    _____________________________________
    Connect With Me:
    Website: www.codestackr.com
    Twitter: / codestackr
    Instagram: / codestackr
    Facebook: / codestackr
    _____________________________________
    ** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
    #codeSTACKr #CSS #learntocode

Komentáře • 90

  • @codeSTACKr
    @codeSTACKr  Před 4 lety +10

    Thanks for all of the support!!
    Next up Learn Sass in 30 Minutes:
    czcams.com/video/BDOzg4lXcSg/video.html
    📚 My Favorite Web Design Books 📚
    Web Design with HTML, CSS, JavaScript and jQuery Set by Jon Duckett (paid link)
    amzn.to/2JaiCL8

  • @bud384
    @bud384 Před 3 lety +9

    # rem
    5:49 => 1 rem (default font size of most browsers is 16px);
    6:31, 6:41 => change the default html font size to 10px (better to set it in rem);
    8:37 => rem is accessibility friendly;
    9:00 => the reason why it is accessibility friendly;
    # em
    8:06 => relative to the font size of the element (the more nested, the crazier it would be);

  • @nhojdrawdecabrera4936
    @nhojdrawdecabrera4936 Před 4 lety +13

    this tutorial is informative to me now that I understand the importance of rem than using em or px thank you :)

  • @martian7913
    @martian7913 Před 4 lety +3

    Your tutorials are very informative and helpful. Keep up great work!

  • @hospitaller100
    @hospitaller100 Před 4 lety +2

    This video deserves more viewers! Thanks a lot!

  •  Před 4 lety +2

    thank you very much, I've been a full stack dev since long time ago, but I used to get confused with rem, em, vw, vh, thanks for this video.

  • @umershabir_
    @umershabir_ Před 3 lety +5

    what should i say to this man? you made my learning so much simpler i have a lot of prayers for you, may god help you in your difficulties, as you are doing in us,

  • @superitboss
    @superitboss Před 2 lety +1

    Thank you so much, very easy to understand. If I watched this before, I wouldn't confuse about difference between percentage and vh vw on the test in class.

  • @yasmeinSalem44
    @yasmeinSalem44 Před 2 lety

    i think this is the most video which deserve a big big big like, thank u so much

  • @Moe.firouzabadi
    @Moe.firouzabadi Před 4 lety +1

    Thank you ! I Whenever I get stuck in something, I know it's always the basics!

  • @chinonsoviktor7777
    @chinonsoviktor7777 Před 4 lety +1

    I just get to know about your channel and I found it interesting and amazing....thanks for all the good works. Am going to watch most of your videos and equally like them. I wish I can get in touch with you.

    • @codeSTACKr
      @codeSTACKr  Před 4 lety

      Thank you! Hit me up on Instagram.

  • @TomHerriman
    @TomHerriman Před rokem +1

    Excellent explanation and demonstration!

  • @dobromirdobrev4692
    @dobromirdobrev4692 Před 3 lety +2

    Very helpful for people who want a clear and concise explanation about the Units of Measurement. Thank you!

  • @Lostpanda123
    @Lostpanda123 Před 4 lety +3

    You are a great teacher. Thank you a lot! You should know that you may actually change others life with these videos!

  • @rhkina
    @rhkina Před 4 lety +2

    Great tutorial! Thank you!

  • @petitcez3719
    @petitcez3719 Před 4 lety +1

    I just discover you channel and you are great, keep it up, you rock ! and of course thank you !

  • @hassanlearning4086
    @hassanlearning4086 Před 5 měsíci +1

    I find helpful concise and easy to understand. Thank you

  • @JL-ky5ev
    @JL-ky5ev Před 3 lety +1

    best explanation of units in youtube,thanks

  • @khalidkhabouz
    @khalidkhabouz Před 2 lety +1

    Thank you so much, clean stuff

  • @thelonercoder5816
    @thelonercoder5816 Před 2 lety

    This was the greatest explanation of units i've ever watched lol.

  • @ProgrammingwithPeter
    @ProgrammingwithPeter Před 4 lety +3

    Your explanations are so good ! Good job!

  • @Fcycfvyvvyvtfutg
    @Fcycfvyvvyvtfutg Před 4 lety +2

    Adore your videos. Thanks so much!

  • @DavidJimenez-vm2ug
    @DavidJimenez-vm2ug Před 2 lety

    dude literally perfect
    subbing

  • @naimurrahman3313
    @naimurrahman3313 Před 4 lety +1

    best tutorial ever. thank you very much

  • @aebek1413
    @aebek1413 Před 2 lety +1

    thanks bro ,now i understand the use of rem well.

  • @imadabab
    @imadabab Před 3 lety +1

    Excellent tutorial. Thanks a lot.

  • @benkuhn8441
    @benkuhn8441 Před 4 lety +1

    Thanks so much - I finally understood the difference now!

  • @azurintegrated5474
    @azurintegrated5474 Před 2 lety +1

    Units of measurement made easy to understand. Great work 👍

  • @chicoselfie1602
    @chicoselfie1602 Před 4 lety +2

    Thank you! You're awesome!

  • @sammclaren6965
    @sammclaren6965 Před 2 lety +1

    Well done! Thnx

  • @sarojsuraweera7134
    @sarojsuraweera7134 Před 3 lety +1

    Informative and Concise. thanks

  • @tong4624
    @tong4624 Před 2 lety

    Kandungan video sangat baik, tahniah

  • @najimali32
    @najimali32 Před 4 lety +2

    That's beautifully explains.

  • @argenisaguilar9045
    @argenisaguilar9045 Před 3 lety +1

    great explanation, thanks so much..

  • @MuhammadUmair001
    @MuhammadUmair001 Před 2 lety +1

    great explanation

  • @rimatadevosyan692
    @rimatadevosyan692 Před 4 lety +2

    Thank u so much!

  • @benmbarekmarouane8676
    @benmbarekmarouane8676 Před 2 lety

    You are the best, thank you

  • @ihorv44
    @ihorv44 Před 3 lety +1

    a lot of thanks for the helpful video

  • @fabioaguiarBR
    @fabioaguiarBR Před rokem +1

    Tks a lot!

  • @l3aIIin23
    @l3aIIin23 Před 4 lety +1

    Thanks!

  • @ahseneremmouche9600
    @ahseneremmouche9600 Před 3 lety

    Thank you very much.

  • @kofukouna1011
    @kofukouna1011 Před 4 lety +3

    I would like this video twice or more if CZcams has the option for it!

  • @jackiemasek8302
    @jackiemasek8302 Před 2 lety

    That’s just great. Is that really your intro-music? I’m going to have nightmares now, you know. 🤣

  • @benyaminyakobi3652
    @benyaminyakobi3652 Před 2 lety +1

    Thank you!!

  • @mithunbarua7537
    @mithunbarua7537 Před 4 lety +2

    Thanks bro

  • @nawets1302
    @nawets1302 Před 3 lety +1

    Thank you!

  • @forhadrh
    @forhadrh Před 3 lety

    I don't know what I have understood or not but I learned ... I have to use - REM! :)

  • @abdurrahman_a
    @abdurrahman_a Před 3 lety +1

    Thank You

  • @RJ-dz1hu
    @RJ-dz1hu Před 4 lety +1

    Thank you

  • @mithunbarua1486
    @mithunbarua1486 Před 4 lety +2

    thank you

  • @jairai2739
    @jairai2739 Před 4 lety +1

    I'm backend dev, and your videos helping a lot to learn this new world front-end, thx a lot man, any chances to make a video with Vue.js?

    • @codeSTACKr
      @codeSTACKr  Před 4 lety +1

      I'm currently working on React videos. After that will be Vue 😁

  • @MrJettann
    @MrJettann Před 3 lety

    Hey, awesome explanation bro! What do you think about using html font size = 62,5% and then use rem?)

  • @dgdanielguzman3
    @dgdanielguzman3 Před 2 lety

    Thank you so much for the video! This was really helpful! One question- at 3:43 in the video you mention that the Div with a width of 50% looks smaller due to padding and margin. I tried looking it up on developer tools and couldn’t find the padding or margin listed. Did you mean the padding/margin from the body? Was the margin from the body affecting the size of the Div since it was the parent element?

  • @user-bc9kk3kb8u
    @user-bc9kk3kb8u Před rokem

    「もっと多くの人が必要なので、このビデオをもっと

  • @ianhnizdo4787
    @ianhnizdo4787 Před 2 lety

    Very helpful. One question I did have though is that HTML is default 16px font size yet when you redefine the html font size in pixels you cannot further alter it in the browser. I'm a bit confused at that.

  • @FrankSmith-eh3pi
    @FrankSmith-eh3pi Před 4 lety +2

    Till now I was blindly using em and rem😬

  • @flower7695
    @flower7695 Před rokem

    Hey! I pretty much understood everything, but I was wondering... if rem is better for accessibility in general, why do professional pages still use px in most cases? I just checked the inspector on several pages and found that they use a lot of em and px

  • @PersonalXZ
    @PersonalXZ Před 2 lety

    Is a 600 dpi image 600pt/72 of 1in or 600px/96th of 1in ?

  • @DenisK-to8lf
    @DenisK-to8lf Před 2 lety

    Sanks

  • @nikolyaishirov5377
    @nikolyaishirov5377 Před 2 lety

    Anda boleh memilih untuk salah satu daripada hadiah di atas

  • @lawrencetian2556
    @lawrencetian2556 Před rokem

    くさんありますありがとうございます」、

  • @duykhanhang2940
    @duykhanhang2940 Před 2 lety

    the video image is too poor, you need to fix it more

  • @user-do6jb6gz2o
    @user-do6jb6gz2o Před 2 lety

    you need to clarify the content

  • @FF-ie6sd
    @FF-ie6sd Před 4 lety

    Could you please remove the beginning music ? Great content but the music is really really really really really not necessary.

    • @elilumilay9405
      @elilumilay9405 Před 4 lety +2

      That is his signature opening for his tutorials just like Brad Traversy and other youtubers. Don't just tell him what to do because its his own youtube videos :)

  • @sumitsahu2051
    @sumitsahu2051 Před 3 lety +1

    get more knowledge in less time.