Simple Explanation Of rem & em CSS Units

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

КОМЕНТАРІ • 281

  • @TraversyMedia
    @TraversyMedia  7 років тому +112

    Had a little time this morning and I have had a lot of questions from people asking about the rem unit in my last video. Hopefully this clears things up. Have a great Sunday everyone!

    • @josefinagonzalez3527
      @josefinagonzalez3527 7 років тому +1

      You are the greatest man! i'm taking my time doing the Angular4 Udemy course! but this little gems (videos) are equally great! thanks again man! Greeting from south america :D

    • @propeller
      @propeller 7 років тому

      thabnks for this tutorial! but i can't see a practical use-case for using rem. what's the benefit besides of changing html font-size in chrome.

    • @tdg710
      @tdg710 7 років тому

      I'm not Traversy Media, but I think I can answer this for you. The whole point of using rem and em is to make the website responsive. It's so someone on a tablet or phone can view the webpage in all its glory, just as someone on a computer could.

    • @propeller
      @propeller 7 років тому

      but responsiveness is in simple means defined by the viewport (width/height of the browserwindow). and rem only relates to the font-size of the html elment. then ok, you can give different font-sizes on different viewport sizes, but how does it make the responsive game easier? I can't see a use case whereI should base all my sizings on one base-setting

  • @hamzajirah
    @hamzajirah 6 років тому +34

    What more can I say; that each time I need clarification on a subject, I have but one place to go; Traversy Media. Five star to you, Mr. Brad.

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

    I don't have words to explain how much this is valuable. Initially when video startup, due to lower voice I heard, I thought this will be boring one. Basically no energy. But it was just a matter of a second. This is awesome and very clear explanation with a directly to subject video. So as a summary, I guess this is a only video you need to check to understand the difference between those. So really appreciated.

  • @gbubemia
    @gbubemia 5 років тому +5

    Simple explanation and demonstrations. I will never forget how to use rem, em, vh, and vw! Thanks a mill!!!

  • @AidanaDreamer
    @AidanaDreamer 5 років тому +73

    Was following a paid tutorial... they made it seem soo complicated. Thank you so much for all your work

    • @miramax1995
      @miramax1995 5 років тому

      Kazakhs everywhere. Привет с Астаны))

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

      I'm not even taking any paid course. Brad's videos along with MDN Web Docs..and some time Academind, Ninja etc. Channels are enough

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

      @Abishek Raju Haha, I almost forgot about this comment

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

      For real though. I'm over here trying to carry the 1 and ish lol. This is spoken in real life language, not Gandolf spoken word riddles. Great job.

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

    What I couldn’t understand after listening 1 hour class in my college , u Made me understand in 15 min . Thank you for this free content

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

    This is the best explanation I could find about this topic, really clear to understand. Thank you!

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

    You are helping millions of people land and survive their job. Thanks for making our life easier.

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

    I'm here because I enrolled for udemy course on bootstrap 4. Thanks Brad for excellent content!

  • @maxiequa567
    @maxiequa567 7 років тому +1

    Finally! A comprehensive, straightforward explanation of this topic. Thanks Brad, exceptional teaching as always.

  • @sues2862
    @sues2862 6 років тому

    The units have been a pet peeve of mine. Your explanation hands down is the best I could find on the web. Easy and to the point. Now, whenever I have an inquiry about anything front-end development. Your channel is the first place I check. Thanks a lot Brad !

  • @raunakhajela
    @raunakhajela 5 років тому +1

    Thanks, Brad, for this awesome tutorial. Relative units always confused and I didn't find any good tutorial which can explain this better except you. You cleared all my doubts and now I am going to change font sizes for all my websites.

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

    This video is better than my bootcamp tutorial on how to use rem and em units. Best and simple explanation I've come across. Thanks👍👍👍👍

  • @AdrienneBing
    @AdrienneBing 7 років тому +7

    Thank you for this simplified explanation I finally got an understanding of this.

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

    I come from your Udemy couse about Bootstrap just to clarify a bit more about REM and EM and it's amazing how clear you explain things. Thanks!

  • @awsmnessdesignstudio5252
    @awsmnessdesignstudio5252 7 років тому

    You are one of my favorite tutors on the internet. Thanks a lot for your teaching style. You helped me a lot.

  • @MAli-o4r1j
    @MAli-o4r1j Рік тому +1

    Beautifully explain sir
    love from Pakistan

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

    This is the best and simpliest explanation about css units, glad that i found this.

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

    wow, after 5 different videos, this was the one i was looking for. Thank you for this clear explanation i was looking for.

  • @sai_charan
    @sai_charan 7 років тому +34

    Some ideas for next videos:
    * Stripe API project
    * Building extension/theme for VS Code/Chrome
    * HTML newsletter design, MailChimp crash course, MJML crash course.
    * Jekyll crash course

    • @KjeKji
      @KjeKji 7 років тому +2

      Jekyll templating

    • @cacianobeast
      @cacianobeast 7 років тому +1

      Testing!!! both unit testing and integragion testing

  • @ga7853
    @ga7853 7 років тому

    Very grateful, did not really know that the rem is relative to html and em is relative to parent.. Thank you so much
    every video that I watch from you I learn something new.

  • @MAli-o4r1j
    @MAli-o4r1j Рік тому +1

    Threre will be no need to watch an other video for rem em
    Thanks sir

  • @iancarr3923
    @iancarr3923 7 років тому

    It's great to get a notification that a new video has been posted. Very helpful content - particularly for someone like me who is learning html, css, etc

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

    I always get amazed how Brad explains everything so clearly & elaborately..... Thanks man 😊

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

    Wow, the viewport height portion is going to be really useful to me. Wish I knew how simple it was a long time ago. I wrote some reusuable code in javascript to make sure the body of a web page will be at least the height of the user's viewport. I've used it on a ton of websites, but now I realized I can just apply this one CSS rule. So simple!

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

    This is the Only Video in UA-cam I Got fully Clarified about CSS Units!! Thank You So Much!! But You Missed out Percentage (%)

  • @doingsneakypeakylike
    @doingsneakypeakylike 7 років тому +2

    Thanks Brad. You really cleared it up with rem and em. I am looking forward to advanced css series if you're planning to make one.

  • @VelezBiH
    @VelezBiH 5 років тому +1

    Thank you for explaining this. I am definitly switching to rem and vh units instead of pixels. I think this is no brainer if we want to build sites that are responsive and also accessible to end user.

  • @coderlady_
    @coderlady_ 5 років тому

    Man! I don't know what to say about your content !!! I watched the video and wanted to like it I found out I already did :) Merci beaucoup, from France!

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

    Finally got the hang of this , thank you brad

  • @popi0370
    @popi0370 7 років тому +2

    Hi Brad, I want to thank you for all your great work, it's very inspiring and it's making me wanna do the same but in my language, if I get to be half as good as you doing this I'll be more than happy. Thanks again and have a nice day!!

  • @donovan8031
    @donovan8031 6 років тому

    Thank you so much for explaining this Brad. I been getting asked about rem in the past few interviews... Thanks to you, I finally understand rems!

  • @thenerd4308
    @thenerd4308 7 років тому +1

    Well appreciated Brad, you are so great trainer and person...

  • @perfectwebsolutions
    @perfectwebsolutions 7 років тому

    Thank You Brad, now got it clearly about px, rem, em and when they change their behavior .

  • @Sandrobevil13
    @Sandrobevil13 6 років тому

    Great videos and special thanks for the pronunciation - clear and understandable. English is not my native language but it is a real pleasure to follow your screencasts. Currently I have no job as a web developer but when I have (hope not so long left till this moment) I'll thank you with some amount of bucks for all the good you've done to me and thousands of people. Thank you very much!

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

      Did you get that job?

  • @Bestate1
    @Bestate1 6 років тому

    I dont have any knowledge of CSS and still I got what an em and a rem are. Thank you

  • @mikedank301
    @mikedank301 7 років тому +1

    Thank you Brad for sharing. Your tutorials are very helpfull and easy to understand.

  • @miashanholtzer291
    @miashanholtzer291 5 років тому

    Super clear explanation of the practical differences and important of rem, em and pixel-based specs. Thanks!

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

    very simple anf straight forward.. i have watched so many videos but this stands out.. kudos!

  • @TomCashTV
    @TomCashTV 6 років тому +8

    Perfectly explained 👌Thank you.

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

    video was 4 years ago but really explained very well. I have watched 2 to 4 videos but didn't understand

  • @petecapecod
    @petecapecod 7 років тому +2

    Thanks Brad this was a great video, and it definitely cleared up some of my questions about the difference between rem/em and pixels. Nice video length too, I thought it wasn't too short or didn't drag on.

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

    your teaching is awesome, today I understood rem and em. thank you so much

  • @zero2advance219
    @zero2advance219 7 років тому

    Thanks for this great tutorial.... It is very easy to understand .... Now all the unit is clear to me....... please keep up doing great tutorial like that.....

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

    they make it looks so complicated
    thanks for making it looks simple

  • @jenjen3
    @jenjen3 5 років тому +2

    Thanks for yet another great, well-explained video!

  • @Tara.Sohrabzadeh
    @Tara.Sohrabzadeh 2 роки тому

    Great video. As a beginner now i know the use cases of em and rem.

  • @IG7799-c4u
    @IG7799-c4u Рік тому

    One more thing is that if you set a font-size of an element using rem units, and use em units to set things like padding on the same element, that will be relative to the font size of that same element. So if the font-size is set to something like 2rem, then 1em = 2rem units.

  • @SunilSkanda
    @SunilSkanda 4 роки тому +8

    Hey, when em is used on padding and margin, it's gonna be relative to that element's font-size. Not to its parent. You didn't mention that.

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

    Wow, your explanation is simple and clear.
    Thanks

  • @ajazmiah
    @ajazmiah 6 років тому +1

    Hey Brad, do you think you can make a video on how to deploy a simple website?? Explaining the things we need to know and understand when putting our site online ?Would be much appreciated

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

    Thank you, your explanation is simple and very easy to understand

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

    Nobody does it better!!!!!!
    Thank you so much

  • @dev_apostle
    @dev_apostle 7 років тому

    at last I have a clear explanation of what this stuff is. very demystifying.

  • @webpad2570
    @webpad2570 6 років тому

    This clarifies my confusion about rem and em. Thank you!!

  • @sparshgupta8078
    @sparshgupta8078 5 років тому

    amazing explanation + short video
    best combination

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

    Wow your video finally gave me a pretty good idea on css units.
    Thanks man.

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

    Wednesday 22nd April 2020
    Learning Class: Simple Explanation Of rem & em CSS Units
    Thank you very much for the explanation about rem and em Mr Brad Traversy.

  • @irinadelgado876
    @irinadelgado876 5 років тому +1

    This is what I was looking for! Thanks Brad

  • @DJizz82
    @DJizz82 5 років тому

    viewport dope!!! defiantly not used to rem, but I’ll start using it now.

  • @KhalilCh
    @KhalilCh 7 років тому

    Thank you for the time to explain these units

  • @emekaosinachig
    @emekaosinachig 7 років тому

    Another nice one from you Brad, more power to you.

  • @BlueIceAce2015
    @BlueIceAce2015 6 років тому

    So...
    rem = relative to html font size
    em = relative to parent font size (em works just like rem if there's no parent element)
    vh = height of element relative to web browser size
    vw = width of element relative to web browser size

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

    Finally all of my confusion is clear.

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

    Thank u, Brad. Super helpful even in 2020

  • @djlilcq
    @djlilcq 7 років тому

    Ill love to see you create a landing page using css grid, i like the way you explain things. Thank you for all this content.

  • @yanivsalman9685
    @yanivsalman9685 7 років тому

    also vmin and vmax are important to mention + em cascade so it was important to show an example of that (:
    search for css units video by devtips to more in depth css units stuff(: thanks for the video brad.

  • @mylifeandhobby2716
    @mylifeandhobby2716 5 років тому

    Ty to u and everyone that makes these video

  • @aynseenqaf5355
    @aynseenqaf5355 6 років тому

    best tut about rem and em

  • @real-ethan
    @real-ethan 7 років тому +1

    Thanks Brad ! All of ur tutorial are awesome. At your convenience, would you make a tabris.js tutorial as it can build hybrid app in javascript without using any framework such as react, vue and angular? Look forward to it!

  • @kevinzhang8974
    @kevinzhang8974 6 років тому

    simple and well done ... thanks Brad.

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

    I love the way u make things look so simple

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

    When using ems, border and padding are relative to the font-size and not to the parent element, only the font-size is linked to the parent element. Border and padding are calculated based on font-size.
    So if parent is 12px, and child's font-size is 2em(=24px), 1em padding will be 24px, not 12!
    Correct me if I'm wrong though...

  • @sivakalyan3121
    @sivakalyan3121 7 років тому

    HI brad our sunday just completed last 3 hrs :) anyways nice video short informative and practically shown to understand all possible cases , thanks

  • @swallowedinthesea11
    @swallowedinthesea11 5 років тому

    REM refers to the root HTML and the band... got it!

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

    I finally understand rem and em! One question, when you went a width of 100vw, why did you have a horizontal scrollbar, and how would you get rid of that without hiding the overflow?

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

    Thank you so much.
    You helped me understand easily.

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

    " 13:24 "
    Thank you. Indeed, it did help.

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

    crystal clear with my doubts

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

    OMG!!
    You're really a saviour, thank you

  • @amandhiman644
    @amandhiman644 6 років тому

    Thank you very much for this tutorial! You explained it very well.

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

    Thank you so much for this video. It clarified a lot.

  • @mohamadhelaly4979
    @mohamadhelaly4979 7 років тому

    Thanx simple and clear you are the best

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

    It was amazing.Such a great video.completely explained!

  • @meetshujah
    @meetshujah 7 років тому

    Thank you sir my concept is now clear about REM,EM :)

  • @navzme
    @navzme 7 років тому +1

    After watching this video finally I have good understanding how rem, em and vh works. Thanks!

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

    as said by everyone this the only video were i can understand this topic

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

    best tutorial for understanding

  • @wilsongaturu134
    @wilsongaturu134 7 років тому +4

    The next video suggestion for me is REM - losing my religion. lol. Thanks for explaining this for us by the way. Great vid.

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

    keep it up bro, liked your explanation and subscribed.

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

    Thank you veeery much for this video:) You explained the topic perfectly!

  • @mmazeto
    @mmazeto 6 років тому +1

    God bless you Brad! Awesome!

  • @macellit
    @macellit 7 років тому

    Excellent explanation!

  • @ArifulIslam-lu8up
    @ArifulIslam-lu8up 3 роки тому

    very very clear explanation. Thanks sir

  • @Dydreth
    @Dydreth 7 років тому

    Fantastic explanation! Thanks so much for this!

  • @tonyjuliendesign-2
    @tonyjuliendesign-2 6 років тому

    awesome job man. Very well explained

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

    Well explained, now I can move on.

  • @jdevcast6527
    @jdevcast6527 6 років тому

    Thanks for your simple explanation.

  • @raviverma8904
    @raviverma8904 7 років тому +1

    thanks brad , again a great video 😊😊 god bless

  • @hiteshchoudhary3412
    @hiteshchoudhary3412 7 років тому +4

    Hi Brad, when is going to coming cpanel series? Eagerly waiting?