Prevent Fixed Navbar from Overlapping Content (Content Shifting Upwards)

Поділитися
Вставка
  • Опубліковано 8 лют 2025
  • 👉 NEW React & Next.js Course: bytegrad.com/c...
    Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
    👉 Add auth to your app FAST: bit.ly/3QOe1Bh
    👉 NEW React & Next.js Course: bytegrad.com/c...
    👉 Professional JavaScript Course: bytegrad.com/c...
    👉 Professional CSS Course: bytegrad.com/c...
    👉 Discord: all my courses have a private Discord where I actively participate
    🔔 Email newsletter (BIG update soon): email.bytegrad...
    0:00 Solution
    #webdevelopment #coding #programming
    Note that my videos may contain mistakes. Always verify yourself that your code is safe and does what you want it to do for your specific situation. You agree by watching the videos that you are solely responsible for any mistakes in your code.
    This channel and all its content is owned & operated by ByteGrad Sp. z o.o. with Tax ID: PL6762676561 .
    .
    TOP resource to LEARN AI for Developers - datacamp.pxf.i... (paid sponsorship & ByteGrad Sp. z o.o. gets commission)

КОМЕНТАРІ • 74

  • @williamthomas2823
    @williamthomas2823 Рік тому +5

    Thank you so much for this clarity. I have just spent hours building a nav bar from scratch and the overlap was frustrating but I finally done and wanted to see if there was a shorter way to do it and here is so again thanks bud

  • @Germane_5
    @Germane_5 Рік тому +5

    I wish I could like this video a million times. 😢
    Thanks.

  • @eethend
    @eethend 7 місяців тому +2

    Im just learning HTML and you have no idea how much simple videos like this help so much. Thanks for explaining straight to the point what the issue was. Congrats on being the one to teach me about z-index existing LOL

    • @black3ru
      @black3ru 7 місяців тому

      real 🤣🤣

  • @abumuslim6763
    @abumuslim6763 10 місяців тому +3

    you are the best, life saver, thx a lot

  • @fannienatourz
    @fannienatourz Рік тому +1

    I have a class project and the deadline is in a few hours but i have been stuck on this for quite a while now. Thank you soo much for this video. It was just what i needed

  • @abelzeleke7369
    @abelzeleke7369 2 роки тому +5

    that's so help full
    I have been googling all day

  • @TheDarknight7000
    @TheDarknight7000 6 місяців тому +1

    Thank you so much for this you have helped me so many times that i dont know how to thank you. You are my savior

  • @Alan_the_Red
    @Alan_the_Red Рік тому +1

    I just set the height of my wrapper div to min-height and it fixed the issue. This is a cool method for a fixed height though!

  • @lutherevangelista605
    @lutherevangelista605 Рік тому +1

    just googled my problem and this video came up. It solved my problem. Thanks!

  • @stellanwae5050
    @stellanwae5050 Рік тому +2

    I got the solution at 0:59 seconds! This was excellent

  • @PepeDaily
    @PepeDaily Рік тому +4

    You're an angel. And thank you for explaining aswell, made so much sense!

  • @yuu8789
    @yuu8789 Рік тому +1

    We have this individual school project and the deadline is tomorrow. I was about to continue where I left of few months ago and realized I'm still working on the layout. I got stuck here and thank god I found this video. Thanks!

  • @GamerToni2
    @GamerToni2 Рік тому +1

    Finally someone who explains this

  • @Al-Miqdad
    @Al-Miqdad 4 місяці тому +1

    Man you're just LEGEND !

  • @ProfeRo9
    @ProfeRo9 6 місяців тому +1

    Thanks bro, simple, understandable and extremely useful :)

  • @softech2937
    @softech2937 Рік тому +1

    thanks for explaining as well ,simply slowly aproach

  • @rotes3106
    @rotes3106 6 місяців тому

    I simply use position sticky instead of fixed. that doesn't cover the contents beneath it and they remain in theri static position. Thanks for the content.

  • @tanmaysamanta4343
    @tanmaysamanta4343 Рік тому +1

    You Sir are a lifesaver!!!!!

  • @RandomFacts-UTube
    @RandomFacts-UTube Рік тому +2

    Thank you so so so much sir. It really works. 🎉

  • @offgridvince
    @offgridvince Рік тому +2

    Exactly what I needed! Thx.

  • @SampleStandard
    @SampleStandard Рік тому +1

    Thanks a lot , your video Helps me in such a good time !

  • @spsmpssm238
    @spsmpssm238 Рік тому +1

    Thankyou so much brother from india🎉

  • @Joe-xo8ns
    @Joe-xo8ns Рік тому +1

    you are life saver

  • @IrfanKhan-jg7ft
    @IrfanKhan-jg7ft Рік тому +1

    Thank you sir, your video is really helpful❤❤❤❤❤❤❤❤❤❤

  • @55BLOCKS
    @55BLOCKS 10 місяців тому +1

    You save my interview project

  • @aminofficial5399
    @aminofficial5399 Рік тому +2

    ❤ wow superb. I fixed it 😊. I watched many videos but not solution finally got ❤

  • @lollipop036
    @lollipop036 7 місяців тому

    ❤thank u soo much I was stuck in this part.

  • @mr.pjarts9142
    @mr.pjarts9142 Рік тому +1

    thank you so much .Love from india ❤

  • @AnnoyingMe9
    @AnnoyingMe9 5 місяців тому

    Thank you bro iam struggling from hours you helped me out❤️

  • @herainpratapsingh1972
    @herainpratapsingh1972 Рік тому +1

    thank you so much broooo
    made my day

  • @houssem224
    @houssem224 Рік тому +1

    thank you for the informations ♥

  • @jociabela9930
    @jociabela9930 6 місяців тому +1

    So useful !! thanks

  • @boniacu
    @boniacu Рік тому +1

    Thanks, mate!

  • @shivendradwivedi8887
    @shivendradwivedi8887 8 місяців тому +1

    You saved my time man 😊

  • @vanshop7335
    @vanshop7335 Рік тому +1

    Thanks for the video

  • @lovelychawla1708
    @lovelychawla1708 9 місяців тому +1

    Thank you very much ❤

  • @book2nez500
    @book2nez500 Рік тому +1

    Thank you so much

  • @IrtizaShahbaz
    @IrtizaShahbaz Рік тому +1

    thank you so much

  • @lucianpascu8445
    @lucianpascu8445 10 місяців тому

    I'm not sure that will work for smaller screens if the header has elements that will wrap. Wrapping means the headers' height will be bigger. Actually, I've just tested before posting.
    Thus, that's not the final solution keeping into account that responsiveness is a must these days.

  • @mahesheditz
    @mahesheditz 6 місяців тому +1

    thankyou very much

  • @rahulguptarahulgupta1363
    @rahulguptarahulgupta1363 6 місяців тому +1

    Thank You👍

  • @SriRamaMaruthi-o6t
    @SriRamaMaruthi-o6t Рік тому

    Is it good idea to fix padding to 60px? Will the toolbar height not change depending on screen?

  • @MohammadHadi-01
    @MohammadHadi-01 8 місяців тому +1

    best , its work! and i sub you beacuse you are best

  • @bucztechph
    @bucztechph 6 місяців тому

    got a problem with this one, but with a responsive navbar. whenever i use the scrollreveal animation my responsive navbar overlapped my content, i already set the z-index high and yet it still not working

  • @samairairam_0794
    @samairairam_0794 9 місяців тому +1

    Thanks bro ✨

  • @R.KFilmsProduction
    @R.KFilmsProduction 11 місяців тому +1

    Thanks Very Thanks you are a great

  • @kashifdeshmukh9340
    @kashifdeshmukh9340 Рік тому +1

    Life saver !!

  • @techrohitjondhale
    @techrohitjondhale 11 місяців тому

    Thanku brother my problem is fixed

  • @carlosromero-sn9nm
    @carlosromero-sn9nm 9 місяців тому +1

    Awesome video

  • @azemazaotaru9788
    @azemazaotaru9788 Рік тому +1

    thank you bro😩😩😩

  • @docodezz
    @docodezz Рік тому +1

    thanks🚀

  • @anguss1917
    @anguss1917 4 місяці тому

    what if i have a background to the section under the nav?

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

    Brother, the marquee scroll is overlapping the navigation bar 😢😢 how to fix that

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

    please i have question
    how to prevent collapsed menu not pushing content down when expanded?

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

    THANK U SO MUCH
    💖💖💖💖💖💖💖💖💖💖💖

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

    THANK YOU

  • @janakaone
    @janakaone 3 місяці тому

    Or you can use position sticky

  • @NokrisMx
    @NokrisMx 5 місяців тому +1

    Muchas gracias :)

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

    My nav bar now stays fixed, however everything scrolls over the top of it. Can you please advise?

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

      Actually, I was wrong. The nav bar is fixed, but everything was scrolling UNDER it. Because it was transparent, you could see the text overlapping. I changed the nav bar background to white, which has solved that problem. However, I have 5 buttons which scrolls to a different section of the page. Each section scrolls to the top of the page and doesn't stop at the nav bar. I've been racking my brain for 2 hours but cannot solve it. Can anyone advise?

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

      ​​@@austinedwards6334hey!i'm in exact situation right now,i will be sooo grateful if u tell me the solution if u figured it out,please!!❤

    • @MrThebigcheese75
      @MrThebigcheese75 11 місяців тому

      @@austinedwards6334 Try using display: sticky and set a top value the size of the navbar. It would be so much easier if you could just set the fixed have have the browser change the available area to be reduced accordingly. CSS is the hack of hacks.

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

    Can you please give me a solution while using tailwind in react web app. I am facing problem using tailwind . Please assist

  • @DouglasPinedaGutierrez
    @DouglasPinedaGutierrez 10 місяців тому +2

    Clutchest video on the internet stg

  • @SenagaTech-Hub
    @SenagaTech-Hub Рік тому

    Beautiful❤❤❤❤

  • @ceezgeez1793
    @ceezgeez1793 Рік тому +1

    z-index:
    THANK YOU

  • @DukofmtzDuke
    @DukofmtzDuke 4 місяці тому

    This is wonderfut indeed

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

    mmmm I want the page content to be h-screen and this just makes it h-screen + 60px which is not what I want

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

    so the answer is: set z-index to 99999 - also works for me

  • @zaminali8989
    @zaminali8989 Рік тому +1

    thank you so much

  • @Rohan-z6l
    @Rohan-z6l 6 місяців тому +1

    thank you so much

  • @DukofmtzDuke
    @DukofmtzDuke 4 місяці тому

    This is wonderfut indeed

  • @DukofmtzDuke
    @DukofmtzDuke 4 місяці тому +1

    This is wonderfut indeed