The Forgotten CSS Position

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

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

  • @WebDevSimplified
    @WebDevSimplified  6 лет назад +65

    Just a note on why I used @supports at the end of the video. If a browser does not support position: sticky it will fallback to position: static instead of position: relative which will make any absolute positioned elements inside the sticky positioned element no longer work properly.

  • @sinc1802
    @sinc1802 3 года назад +26

    Although this video is like 3 years old, it helped me a lot. I was in a desperate moment on how to make my navbar fixed but somehow still relatively positioned according to other elements. The first example in this video is EXACTLY what I was looking for for the past one week. Thank you very much!!

  • @techuchiha6510
    @techuchiha6510 5 лет назад +77

    Simple, Precise and to the point ✌🏻

  • @alfredyeh3553
    @alfredyeh3553 5 лет назад +26

    just learning html and this vid was godsent. I hope everyone starting out can watch your videos

  • @AlexTechie
    @AlexTechie 6 лет назад +15

    Thank you for this video. I've been learning nav bars and I had the same problem you talked about when using Fixed, where the elements below the navbar get bumped up. I didn't know if this is how people were doing it, but I used Fixed because I only know about Fixed+Relative+Absolute. Now, I know to use Sticky, instead. 👍

    • @WebDevSimplified
      @WebDevSimplified  6 лет назад +6

      Sticky is so much nicer to work with than fixed. I hate having to add margins to my content when using fixed because it just doesn't seem right. Just make sure that you check to see if the browser supports sticky position using @supports because it isn't supported in all browsers yet.

    • @AlexTechie
      @AlexTechie 6 лет назад +2

      For sure; that's probably one of the reasons I hadn't heard of it before (even though 90% browser support with prefixes sounds pretty good. IMO). BTW, have you done a video on an image slideshow w/ autoplay + pause + left / right arrows? I'm gonna check right now, but figure I'd include it in this comment instead of messaging you twice.

    • @WebDevSimplified
      @WebDevSimplified  6 лет назад +3

      Yeh 90% really is pretty good. I thought it was around 80 for some reason. As for the image slider, I have not done a video on that topic but there are tons of videos about that so you should be able to find a good one.

  • @SpencerTaylorOnline
    @SpencerTaylorOnline 3 года назад

    This is the best description and instructions on how to use Sticky Position in almost all browsers I have seen.

  • @gelsonwork
    @gelsonwork 10 месяцев назад

    Finally, I've understood the concept of sticky position.
    My warmest thanks ❤❤

  • @matthewsjardine
    @matthewsjardine 2 года назад +2

    This is super cool, and much simpler than I thought it would be. This channel is gold for a noob like me. Thank you for your videos!

  • @christine5906
    @christine5906 4 года назад +3

    Thank you so much for this. I've been struggling to do this in JavaScript. This is simple yet super helpful. You saved me. Thank you so much.

  • @noirsociety
    @noirsociety 5 лет назад +1

    A thousand thanks to you Web Dev Simplified :)

  • @hamzajirah
    @hamzajirah 5 лет назад +8

    I have found yet another genius. Thanks for this content and many others that have helped me understand some #WebDevelopment concepts better.

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

    dude your contents are forever. great job

  • @MichaelCampbell01
    @MichaelCampbell01 4 года назад +1

    I really do like these short, digestable videos where possible.

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

    Brilliant, love the sticky list headers. I will be using this method next time someone wants a sticky bar, instead of having to mess around with JS!

  • @reza.kargar
    @reza.kargar 3 года назад

    The example you have provided is extremely useful for teaching this concept, awesome

  • @yangyu4489
    @yangyu4489 4 года назад +5

    Such a good series!!! Thank you for your hard work!

  • @nanitechinfo6188
    @nanitechinfo6188 4 года назад

    One best sticky simple video I searched lot I got this is the best

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

    super useful - I was doing this for years using javascript :) ...

  • @patrickc.6183
    @patrickc.6183 5 лет назад +3

    Great explanation of position: sticky! I really like your CSS content!

  • @ganesan.r5430
    @ganesan.r5430 2 года назад

    thanks a lot, now I know what is @supports used for, explain more such CSS tips.

  • @suza7383
    @suza7383 4 года назад +1

    Thanks for the explanation,, it was great! I was so confused until now.

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

    thank you for this video, it's really clarified some unknowns for me

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

    Best example how and why to use sticky! Great stuff!

  • @mezirezi1
    @mezirezi1 4 года назад

    Thanks mate; I only knew how to do stiky on excel, now html. I am using that on my current mid term project.

  • @ianfischer103
    @ianfischer103 5 лет назад

    Position: sticky look professional the way you have the header and then the navbar. I enjoyed this video.

  • @josue-cedeno
    @josue-cedeno 3 года назад

    Short, concise videos are the best!

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

    really recommend this channel. he did extraordinary works!

  • @why-mope
    @why-mope 4 года назад

    Great explanations, and the details of how sticky works! Thanks for the comprehensive video.

  • @soultouchingsongs
    @soultouchingsongs 4 года назад

    Full of awesomeness. You are a great tutor. Bless You.

  • @ferozalimeghani2561
    @ferozalimeghani2561 3 года назад

    Vert informative video to understand sticky position. Well done.

  • @TomNuorivaara
    @TomNuorivaara 6 лет назад +17

    Great tutorial! You might want to include the word "sticky" in the video title for SEO purposes :)

    • @WebDevSimplified
      @WebDevSimplified  6 лет назад +6

      Thanks for the feedback. I was trying something different with the title and thumbnail to see how it works. I'm always trying to experiment to find the best way to do things.

  • @justinseegets9629
    @justinseegets9629 3 года назад

    Thank you very much for providing these videos!

  • @sheikabdullah8209
    @sheikabdullah8209 3 года назад

    Really u r super 👍., No words to say ur teaching., Keep rocking bro 👍

  • @MG-bm5oj
    @MG-bm5oj 5 лет назад +1

    Great tutorials. Well explained and going straight away to the point.

  • @AutomationTank
    @AutomationTank 4 года назад

    I would like to repeat the same thing as @TechUchiha said "Simple, Precise and to the point" 👍. Great Job, Keep it up :)
    I am not from the coding background but this made me very clear regarding my doubt. Thanks!

  • @joseglm
    @joseglm 6 лет назад +2

    Great, very practical video, keep them coming!

  • @pensivefuu1885
    @pensivefuu1885 4 года назад

    Super helpful, incredibly simple and easy to understand.

  • @devendrajadhav8538
    @devendrajadhav8538 4 года назад

    Thank you so much for this wonderful tutorial it helps a lot

  • @sapindersingh1165
    @sapindersingh1165 4 года назад

    You're really a fantastic teacher. Keep it up!

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

    Thank you so much, this video made my day ❤️

  • @josephkatongole4659
    @josephkatongole4659 4 года назад

    Thank you for this video. It’s really precisely helpful

  • @DashrathBhil-h2f
    @DashrathBhil-h2f Месяц назад

    Thanks for making it simple 🤗

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

    Thank you for sharing such knowledge

  • @karthikeyan878
    @karthikeyan878 4 года назад

    Clear Explanation !! Thanks a lot

  • @negritoojosclaros
    @negritoojosclaros 4 года назад +4

    you've save my life.

  • @manish-mk
    @manish-mk 2 года назад

    What a precise explanation !

  • @codespector1989
    @codespector1989 4 года назад +1

    its a great explanation of position:sticky. Thanks
    DO you know any resources/templates for practice to become a professional web designer

  • @RabiaKhan-pm7ts
    @RabiaKhan-pm7ts 3 месяца назад

    made me fall in love!! ty!

  • @PawanKumar-tu6ti
    @PawanKumar-tu6ti 3 года назад

    Thanks brother, you helped me!

  • @bertilow
    @bertilow 5 лет назад

    Very well explained. Thank you!

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

    So well explained

  • @albenideslyma
    @albenideslyma 5 лет назад +2

    Obrigado amigo, ajudou muito.
    Ganhou mais um inscrito.

    • @ed1nh0
      @ed1nh0 5 лет назад

      What about thank him in his language?

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

      @@ed1nh0 😂😂😂

  • @buithanhlam3726
    @buithanhlam3726 4 года назад

    Great explaination!

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

    Thanks a lot. Love your videos.

  • @noob.gamers.official
    @noob.gamers.official 4 года назад

    Please make a video for display elements.

  • @aadeekale
    @aadeekale 3 года назад +1

    how .header-large gave that image in the body even if the div isn't styled in css or style

  • @DeepThinker193
    @DeepThinker193 4 года назад

    Wow, was about to use JQuery for this simple task as I'm noob. But this saved me.

  • @mateenahmedkhan3780
    @mateenahmedkhan3780 4 года назад

    i didnt know about @support :+1 for it!

  • @Star-zf8su
    @Star-zf8su 5 лет назад

    Lol....I used to use JavaScript for this simple stuff thanks very much for sharing

  • @Vega004
    @Vega004 3 года назад

    Thanks again buddy👍

  • @parasarora5869
    @parasarora5869 6 лет назад

    nice video...glad to see it😄 ... now i know more about sticky position. thank you kyle✌

    • @WebDevSimplified
      @WebDevSimplified  6 лет назад +1

      Thanks for giving me the idea for the video!

    • @parasarora5869
      @parasarora5869 6 лет назад

      @@WebDevSimplified no problem... I will wait for the next video😁

    • @WebDevSimplified
      @WebDevSimplified  6 лет назад +1

      @@parasarora5869 it will be out in just over 24 hours.

    • @parasarora5869
      @parasarora5869 6 лет назад

      @@WebDevSimplifiedI will definitely see that...thanks for info😄

  • @dalmecsystems1251
    @dalmecsystems1251 4 года назад

    Excellent video! Thanks for posting! Can this be used to make items stick on the left too? I'm thinking of spreadsheet-style columns that stay on the left as you scroll across.

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

    Surely I enjoyed very much.❤

  • @annismonadjem6901
    @annismonadjem6901 4 года назад

    Great video! Thanks.

  • @mod7ex_fx
    @mod7ex_fx 4 года назад

    the best teacher ever

  • @kirankothandan5529
    @kirankothandan5529 3 года назад

    Absolutely gold

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

    Simple and clean

  • @Zhearun
    @Zhearun 3 года назад

    Using the workarounds to make sticky work on browsers really feels like "Oh, you don't support sticky? Just support it lol"

  • @alimohammadi1517
    @alimohammadi1517 3 года назад

    Great vid man , subed

  • @AmmarAhmey
    @AmmarAhmey 5 лет назад

    Great .. easy.. awesome explanation :)

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

    Sticky act with respecting the parent's relative position, while fixed don't care about parent's relative position and directly jump to the top most position of the page.

  • @christianvargan6015
    @christianvargan6015 6 лет назад +1

    Thank you so much!

  • @pulkitgupta5039
    @pulkitgupta5039 3 года назад

    When I am using position: sticky element stack up on each other and then, I am using background-color: transparent last one is visible. But in the video he said " it no longer remain fixed".

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

    Question: Why do you use the style tag instead of a separate CSS file? Wouldn't that violate separation of concerns? Is it more for tutorial sake so that you aren't flipping between files constantly while explaining and demonstrating your examples? (Which would make sense if that were the case)

  • @forexspectrum4799
    @forexspectrum4799 10 месяцев назад

    Thanks a lot sir ❤

  • @ANILKUMAR-ye3rq
    @ANILKUMAR-ye3rq 4 года назад

    Thankyou very much .

  • @afullstackboss8481
    @afullstackboss8481 4 года назад

    Hello Kyle, can you make a video on xpath with html, css and javascript demo project? Thanks

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

    Mashallah, Best RUclipsr Ever

  • @marinastrong7977
    @marinastrong7977 19 дней назад

    Thanks

  • @sakshamchhatkuli271
    @sakshamchhatkuli271 4 года назад

    Thank you so much

  • @ThazirM
    @ThazirM 20 часов назад

    How does class header- large inside div produces an image ..
    I'm confused! Help me!!!😓

  • @palachokrab5711
    @palachokrab5711 3 года назад

    Beautiful n clean

  • @achengster4
    @achengster4 4 года назад

    I look for Kyle (Web Dev Simplified) whenever I have a coding question.

  • @kaiixerhub
    @kaiixerhub 3 года назад

    Can I use this sticky position on a tag?

  • @adalovelac24
    @adalovelac24 3 года назад

    very useful thanks

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

    Thank you

  • @stupidname638
    @stupidname638 5 лет назад +1

    You said that sticky falls back to relative when not supported by the browser so then why to we need to use that @support part when it will automatically become relative anyways if not supported by the browser ?

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +1

      This is because by default elements are static position so if it falls back to relative position you could get some weird bugs where the top/left/right/bottom values you specify on the element cause it to perform strangely in non-supported browsers.

  • @astuces.tech2.0
    @astuces.tech2.0 Год назад

    1:43 Where this image come from though ?

  • @kams196
    @kams196 3 года назад

    How did the image appeared in the heading just by adding the

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

    🎉 game changer !

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

    Please show ALL the cases where sticky doesn't work.
    Can't get it to work on my website and forced to use intersection observer instead...

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

    thank you

  • @santhoshn3766
    @santhoshn3766 4 года назад

    Thanks!

  • @zakibonfoh6287
    @zakibonfoh6287 5 лет назад

    You're the G.O.A.T!

  • @exploringgnawing3248
    @exploringgnawing3248 3 года назад

    How do you stop this from bleeding into your footer? (ie. part of a sidebar?)

  • @srinaths2361
    @srinaths2361 3 года назад

    postion: sticky and overflow:hidden not working in nested table

  • @tonynunes1496
    @tonynunes1496 4 года назад

    nice
    didactic, thank you!!!

  • @himankverma125
    @himankverma125 3 года назад

    thanks

  • @mubafaw
    @mubafaw 3 года назад

    You're the truth 👍

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

    Thanks :D