CSS Absolute vs Relative Position EXPLAINED!

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025

ความคิดเห็น • 185

  • @ro3843
    @ro3843 4 ปีที่แล้ว +24

    I've watched a number of videos on positioning in css and this absolutely (pun) is the clearest explanation with understandable examples. anyone who doesn't get this simply isn't paying attention closely and may need to watch the video a few times over. looking forward to more of your vids!

  • @siriusgd4753
    @siriusgd4753 6 ปีที่แล้ว +80

    Very useful. I may have to watch again a couple times to get it set in my brain but this is the best explanation so far.

  • @halifaxlithos2488
    @halifaxlithos2488 ปีที่แล้ว

    Addendum to my earlier expression of gratitude:
    I "thought" I understood your explanation, but I really didn't. It took me several days to figure out that one of my assumptions was just plain wrong.
    However, after watching your video a few more times, and paying attention, I was able to figure it out. So, again I must thank you.
    Thank you!

  • @passingby1350
    @passingby1350 5 ปีที่แล้ว +5

    Actually seeing people show the difference is way better than having it explained in words lol, thanks.

  • @justanothercuriouscat
    @justanothercuriouscat 3 ปีที่แล้ว +4

    Custody is complicated when parents can't get along.
    Kidding aside, this is the best simplified explanation so far! Thank you!

    • @rashwini5467
      @rashwini5467 5 หลายเดือนก่อน +1

      LMFAOOO, clever one

  • @alexiospapadopoulos9601
    @alexiospapadopoulos9601 4 ปีที่แล้ว +20

    Video summarized in a few words:
    ~ Relative: Used to position the element based on the webpage's sides. (top,bottom, left, right). So when you use top: 50px; for example, you position the element 50px from the top of the whole website.
    ~ Absolute: Used to position the element based on the sides of the PARENT element. So by doing top: 50px; with this one, you are positioning the element 50px from the top of the parent element.

    • @nectarichard6775
      @nectarichard6775 2 ปีที่แล้ว +1

      this is what i needed

    • @w0rd735
      @w0rd735 2 ปีที่แล้ว +1

      I may be wrong but isnt it opposite?

    • @vikk1249
      @vikk1249 2 ปีที่แล้ว

      This seems opposite

  • @rabiyabibi4821
    @rabiyabibi4821 4 ปีที่แล้ว +1

    Best explanation.Understand in one attempt although watched lot of stuff before this video but could not understand.Thousands likes.Good work.Really appreciate it.

  • @amalaljohari9358
    @amalaljohari9358 4 ปีที่แล้ว +2

    It's the first time I understand the difference, thank you for the video, you're the best one who explained this topic

  • @Webnoob
    @Webnoob 6 ปีที่แล้ว +32

    The basics are always important. Thx for sharing your great content. ;-)

    • @emmittsutton3561
      @emmittsutton3561 3 ปีที่แล้ว

      I know I'm kind of off topic but do anybody know a good website to stream newly released series online ?

  • @rishabhgupta2085
    @rishabhgupta2085 3 ปีที่แล้ว

    when people say that they want good content, this is what they mean. great video

  • @Navii-CN
    @Navii-CN 4 ปีที่แล้ว +1

    I watched many videos on position but i didn't get any clarity, but this one is good and with in 3:36minutes I got an idea on relative and absolute.. Thanks for this video.

  • @leeman3749
    @leeman3749 8 วันที่ผ่านมา

    the best explained video on this topic. easily understood. thanks so much

  • @dianisna1247
    @dianisna1247 20 วันที่ผ่านมา

    thanks bro, absolutely the most easily understanded video about this topic. thanks a lot

  • @shabinashukoor5430
    @shabinashukoor5430 3 ปีที่แล้ว +3

    Thank You so much for this very clear, straight-to-the-point, no-frills, yet elegant and concise explanation. I've subscribed based on the creative intelligence and simplicity of your teaching approach on a tricky topic, based on this 1 video :)

  • @set_app
    @set_app ปีที่แล้ว +2

    So basic yet so essential! Much nicer explanation than GPT 😁👍🏻

  • @slayermm1122
    @slayermm1122 ปีที่แล้ว

    most concise explaination i've ever watched, thanks

  • @mdsaddamhossain
    @mdsaddamhossain 11 หลายเดือนก่อน

    Completely mind-blowing teaching! Do you have any CSS playlist?

  • @adrianqx
    @adrianqx 2 ปีที่แล้ว

    Need this once in a while to refresh my mind thanks , clear and concise

  • @1AlejoYT
    @1AlejoYT 3 ปีที่แล้ว

    Thank youuuuu. Crazy how something so simple can make you struggle at the beginning :D

  • @hosseinghanaati728
    @hosseinghanaati728 6 ปีที่แล้ว +101

    just made me more confused

    • @infoharvester
      @infoharvester 5 ปีที่แล้ว +10

      watch it a coupple times more. I had to. I got it in the end

    • @neatpolygons8500
      @neatpolygons8500 4 ปีที่แล้ว +1

      maybe you are THAT stupid

    • @gayathri-8-i6s
      @gayathri-8-i6s 2 ปีที่แล้ว

      Turn on the subtitles and watch;! it'll be understood

    • @superkinguniverse
      @superkinguniverse ปีที่แล้ว +3

      Let me explain
      Suppose you have two divs - div1 and div2
      Div2 is inside div1 ->


      So if you give position: relative to div 2 , it will be remain in lts current position, so you can use top: , left: , if you want to move the div from it's original position
      And if you give position: absolute to div2, So you have give position: absolute to div 1 also , So it (div2) will take position of div 1 , if you use top and left in this div you can see it is moving not from it's original position, it is moving from the div 1 position

    • @somadinakyrian3064
      @somadinakyrian3064 5 หลายเดือนก่อน

      @@infoharvesterAswear

  • @Acesif
    @Acesif 3 ปีที่แล้ว

    I've been confused about this even after watching so many tutorials, but this one did the trick

  • @yesican3073
    @yesican3073 4 ปีที่แล้ว

    Clear explanation, no bla-bla. Great job! Thanks a lot! Like the video.

  • @forg_tfuI
    @forg_tfuI 3 ปีที่แล้ว +2

    very helpful thank you 🙏

  • @andromilk2634
    @andromilk2634 ปีที่แล้ว

    Thanks, very clear explanation! Best so far I have found.

  • @dalewatson3978
    @dalewatson3978 4 ปีที่แล้ว

    1:45 why the box2- absolute still in the center ? the box-1 is unset, shouldnt box-2 goes outside to the top-left of the window too ?

  • @fathah7205
    @fathah7205 4 ปีที่แล้ว +4

    when you realize the red stapler stapler is a white stapler, thanks for the video btw it helped alot

  • @javierpizarro7806
    @javierpizarro7806 4 ปีที่แล้ว

    This is the simplest i have come to, thanks althought i don't feel 100% confortable i got a better more solid understanding

  • @deepakatmaprakash1632
    @deepakatmaprakash1632 4 ปีที่แล้ว

    great video... better & easier explanation than all other lengthy videos

  • @vivianeb90
    @vivianeb90 3 ปีที่แล้ว +1

    By far the best tutorial on this topic!

    • @sergiohilario426
      @sergiohilario426 3 ปีที่แล้ว

      you sure about that?

    • @vivianeb90
      @vivianeb90 3 ปีที่แล้ว

      ​@@sergiohilario426 It's just my opinion. Do you know a better one?

  • @themessagist
    @themessagist 4 ปีที่แล้ว

    And just like that, something that was confusing me has been simplified. Awesome!

  • @frontend9206
    @frontend9206 3 ปีที่แล้ว

    Best explaination i ever seen

  • @shindensen6664
    @shindensen6664 4 ปีที่แล้ว

    this is much more easier to understand compare to the previous videos i watched

  • @halifaxlithos2488
    @halifaxlithos2488 ปีที่แล้ว

    Thank you for explaining this so well.

  • @sravyasirikonda1117
    @sravyasirikonda1117 2 ปีที่แล้ว

    It is a comprehensive video, I must say!

  • @walterbanda138
    @walterbanda138 10 หลายเดือนก่อน

    Why isn’t box 2 attached to body when we set position absolute just as box 4. Isn’t it that box 1 has position unset ?

  • @kriziacarissepangan1590
    @kriziacarissepangan1590 2 ปีที่แล้ว

    Clear as crystal!! Wooaah! Thank youu! God bless! New subscriber here!

  • @trimalakismeno
    @trimalakismeno 14 วันที่ผ่านมา

    Interesting explanation, thank you!

  • @aakhildasz
    @aakhildasz 2 หลายเดือนก่อน +1

    great explantion but one issue with your channel logo, your channel name is red stapler, but In the channel logo the stapler is white instead the background is red 😆

  • @awabelmahe9700
    @awabelmahe9700 2 ปีที่แล้ว

    Great video, your explanation is very clear and consious. Thank you very much.

  • @pavelstreletsky1964
    @pavelstreletsky1964 6 ปีที่แล้ว +1

    Thanks for explaining it, i thought the parent is supposed to be relative for the absolute to work properly

  • @machikomacine6810
    @machikomacine6810 3 ปีที่แล้ว

    I am on the way learning position, and then I realized that when we are using position we do need to combine with top/right/left/bottom too, is that right?

  • @athatien8303
    @athatien8303 4 ปีที่แล้ว

    Your explanation is quite clear, however, you should volume up your voice a little bit so it can be easier to be listened to

  • @johnconley4955
    @johnconley4955 4 ปีที่แล้ว

    Thank you for that, so much easier to understand now I've watched it a couple of times

  • @axelfoley6511
    @axelfoley6511 3 ปีที่แล้ว

    why doesn't box 2 positions itself in the top left corner when it is set to "absolute" ? There's no positioned parent to box2...

  • @RCS-CHARTS
    @RCS-CHARTS 4 ปีที่แล้ว

    So then "position: relative" means the box will be placed according to where it'd had been if it was "position: absolute "?
    So "position: relative" without any extra property, will look like "position absolute"?

  • @ruchitmicro8409
    @ruchitmicro8409 6 ปีที่แล้ว +29

    I am still confused

  • @rejinks9489
    @rejinks9489 4 ปีที่แล้ว

    thanks red stapler for making this video🙏

  • @francisjacquart9618
    @francisjacquart9618 3 ปีที่แล้ว

    AT GOOD LAST A CLEAR EXPLANATION! THANKS SO MUCH FOR THIS VIDEO. I HAD FORGOTTEN MY MATHS AND NOW I DO UNDERSTAND IT ALL HERE. COULD YOU ALSO DO OTHER VIDEOS ON FIXED, STICKY, ETC. THANKS...LOVE AND TAKE CARE!

  • @atulrana1536
    @atulrana1536 3 ปีที่แล้ว

    Sir position Absolute May Problem is coming when the positive Absolute commits his lower element to his upper body. How to fix ???

  • @wiamstudy3180
    @wiamstudy3180 3 ปีที่แล้ว

    best explantation thank you and keep going .

  • @GamerFromVoid
    @GamerFromVoid ปีที่แล้ว

    Is not static is the default value for position why it was set to unset bt default?

  • @emmanuelfabiani8435
    @emmanuelfabiani8435 4 ปีที่แล้ว

    Great video, great explanation....In order to fully understand though I would recommend everyone to replicate your examples in their code editor...
    Amazing Job!!

  • @life_life237
    @life_life237 6 หลายเดือนก่อน

    clear concise and straigth to point

  • @DeroCodes
    @DeroCodes 7 หลายเดือนก่อน

    Excellent explanation

  • @vinao_4558
    @vinao_4558 5 ปีที่แล้ว

    wow , thanks for your help! its seems to be easy, but sometimes confuses even the most experient. thank you.

  • @muhammadbilalsharif1210
    @muhammadbilalsharif1210 10 หลายเดือนก่อน +1

    Bro's Intro Music 💀💀

  • @kadidibwa968
    @kadidibwa968 2 ปีที่แล้ว

    Excellent explanation.

  • @thatmarinescienceguy
    @thatmarinescienceguy 2 ปีที่แล้ว

    This seems like a really great video with well explained material.. but I can't focus on the narration as my brain picks up the music first and in a few seconds I realize I have no idea what's going on in the video... it's really hard for me to follow along... but it seems really well put together.. I got half way through.. I've paused.. gone back.. but my brain picks up the music first over the narration time and time again... Ugh! Good video though, I just wish I could watch it.

  • @marventurino
    @marventurino 3 ปีที่แล้ว

    I understood perfectly. Thank you. All very clear

  • @omidasadi2264
    @omidasadi2264 3 ปีที่แล้ว

    great video...thanks...and a question....which is better for top, bottom, left or right parameters in position absolute using? px or percent?

  • @ModernDayMania61
    @ModernDayMania61 4 ปีที่แล้ว

    question: when you change box 4 to relative while top and left is value to 0, where would the box positioned?

  • @xerxius5446
    @xerxius5446 5 ปีที่แล้ว +4

    oh my god! I never knew this until now. i feel like an idiot

  • @TheTaylor237
    @TheTaylor237 3 ปีที่แล้ว

    Very nice explained. Thank you!

  • @sophiaonyoutube
    @sophiaonyoutube 7 หลายเดือนก่อน

    well-explained! thank you very much!

  • @aryyohansson2238
    @aryyohansson2238 ปีที่แล้ว

    awesome and quick explanation. thank you!

  • @navjotsinghvirk7449
    @navjotsinghvirk7449 4 ปีที่แล้ว

    thank you the video covers the concept brilliantly

  • @terryrocker8681
    @terryrocker8681 4 ปีที่แล้ว +1

    at first watch it is like Arabic, after the second watch you'll get it perfectly, if not, try the 3rd watch.

  • @teeyiheng4697
    @teeyiheng4697 2 ปีที่แล้ว

    Thank, you clear my confusion😁

  • @mo7a909
    @mo7a909 3 ปีที่แล้ว

    thank you this was a clear explanation

  • @kvassbo
    @kvassbo 6 ปีที่แล้ว +2

    I use them alot, but know I know how they actually work. Thanks! ;-)

  • @Lack_Of_Enemies
    @Lack_Of_Enemies 7 หลายเดือนก่อน

    Great explanation thanks

  • @ovcharkavg7360
    @ovcharkavg7360 4 ปีที่แล้ว +3

    Спасибо. Доходчиво, коротко и ясно!

  • @olawaseem
    @olawaseem 5 ปีที่แล้ว

    That's a clear explanation.
    But please, can you add the whole code of CSS to the description?
    Regards.

  • @hotcoffeehero
    @hotcoffeehero 5 ปีที่แล้ว

    Clear and concise. Many thanks.

  • @damercadoo
    @damercadoo 5 ปีที่แล้ว

    Great explatanition , My advice: watch it from 0:28

  • @mr_matata
    @mr_matata 5 ปีที่แล้ว +2

    i didn't know a parent div size could be determined by it's children div

    • @hotcoffeehero
      @hotcoffeehero 5 ปีที่แล้ว

      When box-1 became only its padding, I was like whhhhhhhaaaaaaaaat......

  • @joakimjocka8022
    @joakimjocka8022 5 ปีที่แล้ว +1

    hey can you share the source code for this turtorial, i think it would be really useful to use for testing

  • @sumanthachark
    @sumanthachark หลายเดือนก่อน

    Great visualization!

  • @abhimanyushekhawat2626
    @abhimanyushekhawat2626 4 ปีที่แล้ว

    Thanks. This was really helpful

  •  หลายเดือนก่อน

    This is great, but at least for me it would have helped if the boxes weren't named box-1, box-2, etc. The names could have included the color too. I mean: box1-pink, box-2-yellow, etc.

  • @ramya..6902
    @ramya..6902 2 ปีที่แล้ว

    Very clear explanation,, keep doing 👏 @@@

  • @danteeep
    @danteeep 2 ปีที่แล้ว

    that makes so much sense !! thanks

  • @YannMetalhead
    @YannMetalhead 5 หลายเดือนก่อน

    Good explanation.

  • @smartnoobgamer8292
    @smartnoobgamer8292 2 ปีที่แล้ว

    Crisp and clear👌👍👍👍

  • @marlostraub7312
    @marlostraub7312 3 ปีที่แล้ว

    Very helpful, thank you!

  • @joshbakit
    @joshbakit 4 ปีที่แล้ว

    Understandable. Thank you for this

  • @Lorant1984
    @Lorant1984 2 ปีที่แล้ว

    Short and sweet!

  • @Ghaleon
    @Ghaleon 6 วันที่ผ่านมา

    Thank you!

  • @t_rm2119
    @t_rm2119 2 ปีที่แล้ว

    Absolute is positioned to parent and relative from the original place

  • @lionibhrahimovic6382
    @lionibhrahimovic6382 2 ปีที่แล้ว

    I came here to clear my doubts. I now have added more and more doubts 😫😫

  • @YuvrajKumar-ej8tx
    @YuvrajKumar-ej8tx 2 ปีที่แล้ว

    Best explanation

  • @5hatto678
    @5hatto678 5 ปีที่แล้ว +1

    Great one for me.

  • @nagarajutirumani8760
    @nagarajutirumani8760 ปีที่แล้ว

    Nice Explination

  • @ParitoshSinha207
    @ParitoshSinha207 2 ปีที่แล้ว

    Well explained

  • @snehithtampa7106
    @snehithtampa7106 4 ปีที่แล้ว

    I still didn't get that. Can you explain it in much more simple way?

  • @AdeelAhmad0007
    @AdeelAhmad0007 8 หลายเดือนก่อน

    Amazing Content

  • @trex18369
    @trex18369 4 ปีที่แล้ว

    Best explanation thank you very 🙏

  • @neatpolygons8500
    @neatpolygons8500 4 ปีที่แล้ว +1

    brilliant

  • @yunusyasin6843
    @yunusyasin6843 3 ปีที่แล้ว

    What a beutifull content it is very usefull man tnx

  • @ahmadluai5889
    @ahmadluai5889 4 ปีที่แล้ว

    i dont get how u centered the boxes