Responsive Navbar with HTML, CSS and JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ค. 2024
  • Learn how to build a responsive navigation bar, starting from scratch, using HTML, CSS and a bit of Vanilla JavaScript.
    Code for this Project:
    codepen.io/Coding_Journey/pen...
    Support the Channel 💙☕🙏
    PayPal: paypal.me/CodingJourney
    Suggested Videos:
    Smooth Scroll with CSS: • Smooth Scroll with CSS
    Smooth Scroll with JavaScript: • Smooth Scroll with Jav...
    Font Awesome 5 Icons: • Font Awesome 5 Icons
    Thanks for watching! For any questions, suggestions or just to say hi, please use the comment section below!
    Codepen: codepen.io/Coding_Journey/
    Twitter: / codingjrney
    Email: codingjourney123@gmail.com
    Subscribe 💖
    / @codingjourney
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Music provided by NoCopyrightSounds.
    Track: Defqwop - Awakening [NCS Release]
    Watch: • Defqwop - Awakening | ...
    Free Download / Stream: ncs.io/AwakeningYO
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

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

    Helpful video for navbar responsive, link workin, pages display, thanks sir.
    😍😍😍🌹🌹🌹💞💞💞👍👌🙏

  • @Tony-pe3kp
    @Tony-pe3kp 5 ปีที่แล้ว +1

    Man this is awesome! THANKS

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

    You did it again! :) Excellent big thanks!

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

    Very nice!

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

    This is a JEWEL of a tutorial on horizontal responsive navbar with mobile menu -- and with broader browser compatibility than those based on flexbox & css grid. Would be great to see you extend this tutorial to the case where the navbar, at desktop viewport, is limited to max-width of say 1170px and centered horizontally. Another great feature would be to put a topbar (above the navbar) with say phone & email floated left and then social icons floated to right. Last suggestion would be to add scroll to sticky, after scrolling the height of topbar. Thank you for this EXCELLENT TUTORIAL and making the code available.

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

      Thanks for the nice words man! 🙂 Although I may have to remake the tutorial at some point using flexbox instead of float...browser support has gone a long way since I've uploaded this video (for flexbox it is currently at around 98%, which is good enough for me 🙂). Well, if for example you want to limit the navbar content to 1170px and center it, all you have to do is to include it within a container...e.g.:
      HTML
      ...
      CSS
      .navbar-content-container {
      max-width: 1170px;
      margin: auto;
      }
      A bit more effort is required for the other features, but really nice suggestions, thank you!! 👍🙂

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

    Thanks for the explaination!

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

      My pleasure! Very glad you liked it 💙

  • @md.hridoy6094
    @md.hridoy6094 5 ปีที่แล้ว

    Thank you so much

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

    Wow this is exactly what I was looking for thank you.

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

      Thanks man! Glad you found it useful. Btw I like what you are doing with your channel. Keep it up!!

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

    Great content ! thank you ever so much for sharing !! It`s invaluable help for someone who`s learning!!

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

      Very very glad to hear that 🙂 Pleasure is absolutely, totally mine!! 🙂

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

    niiiiice man, thank you !

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

      Amazing! Glad you liked it 🙂

  • @user-fd6ky1bp7h
    @user-fd6ky1bp7h 5 ปีที่แล้ว

    your codes are very beautiful and maintainable..

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

      Thank you Самады my man! Enjoy the journey :)

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

    nice ...

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

    Dude you should have a tv show!

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

      Heheh 😄 wrongdogg my man, I really think I would be the wrong dogg for this job 😉😂

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

    Great content, thanks Coding Journey.
    I'm getting a syntax warning on js line 12 - "navbarLinks.forEach(elem => elem.addEventListener("click", navbarLinkClick));", probably being over cautious; can you spot anything?
    Thanks & Regards.

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

      Glad you liked it! Line looks correct and by the way you can find a link to this project in the description. Only problem could be if you are using a browser which does not support fat arrow functions, such as Internet Explorer. In this case you could replace this line of code with the following:
      for(let i=0; i

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

      Thanks @@CodingJourney , yes I copied from Codepen as a last resort; the error still appeared in Adobe Dreamweaver. It's not showing any problems whatsoever in the browser, it was just a code hinting problem.
      I thought I'd query it as google is very strict with js. Any errors in the code, render fine in the browser but would cause the google bot to disregard anything on that page below the jumped out code I think.
      Thanks again for the tutorial.

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

    after i upload this code on same code on server , doesn't open mobile view on mobile its still open Desktop view

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

      Hey man! Obviously I can't debug without seeing your code, but given that you used the exact same code, maybe you forgot to add the following tag for responsiveness (in the ):
      All the best, keep it up!!

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

    I really believe that you are one of the best teacher out here, but can you please let me know why I keep having the Uncaught ....SyntaxError: Identifier 'navbarToggler' has already been declared.... for ( const navbarToggler = document.querySelector(".navbar-toggler");
    ) ... please help here I can not use the button even though I coped exactly every step

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

      Hey, thank you for the nice words 🙂 Well, it is always very hard, if not impossible, to debug without looking at the code, but the error you are getting suggests that you are redeclaring the "navbarToggler" variable. Is there some other place in your code where you are declaring it (const navbarToggler = ...)? You can find a link in the description to this project, so that you can compare with your code! All the best, keep coding!! 😉

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

      @@CodingJourney thank you so much for the response, I will try, but when I changed the cpnst to var it worked.

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

      @@CodingJourney you know what I figured it out, it is because I linked the external JS file twice in the HTML link , yaaaaaaaaay

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

      Excellent!! Debugging is inevitable, if something works fine from the first time, I feel kind of worried 🙂 Keep up the good work!!

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

      Yeap, var allows you to do that...but it is not advised 😉

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

    Hey