Responsive Navigation Bar with mobile menu Using HTML & CSS

Поделиться
HTML-код
  • Опубликовано: 6 июл 2024
  • In this video, I show you how to create a responsive navigation bar with mobile menu using HTML, CSS, and a little bit of javascript. This navbar will work on mobile, tablet, and desktop view sizes. I also included a cool micro animation with the hamburger menu to make the navigation bar more interesting and interactive.
    Source code: github.com/javascriptacademy-...
    Interactive playground: codesandbox.io/s/agitated-tu-...
    Timestamps:
    00:00 Intro
    00:20 Desktop HTML
    01:50 Desktop CSS
    04:36 Mobile HTML
    05:15 Mobile CSS
    08:18 A little javascript
    Where you can find me?
    🔗 Links:
    * 🍺 Support free education and buy me a beer: ko-fi.com/adamnagy
    * 💬 Discord: / discord
    * 📧 Newsletter: www.getrevue.co/profile/dev_a...
    * ✍️ Blog: dev.to/javascriptacademy
    * 🐦 Twitter: / dev_adamnagy
    * 📷 Instagram: / javascriptacademy
    #navbar #responsive #html #css

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

  • @DevTeacher
    @DevTeacher 2 года назад +12

    Finally a developer who understands the difference between ID and CLASS and who don’t use only class to everything. Keep up the good work !

  • @itsyoboiarroi
    @itsyoboiarroi 2 года назад +1

    you're the best person i have met so far, this tutorial is super amazing, anyone new watching this vid i recommend to add transition to the ul li, it will look smooth,
    for real this is the only tutorial worked for me so far, thanks for the work, you're really awesome

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

      Thanks for the kind words dude! 😊
      Yeah, transitions will make this ui super cool. I just wanted to kepp this tutorial as simple as I could 🙂

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

    thank you very very much I was searching for hours for an easy to understand responsive nav bar.

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

    Thank you for the helpful content. Do you have a version that includes a dropdown menu option?

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

    Hey Adam, I appreciate the hard-work you put into this video, it's perfect! Quick question, what would I need to do to disable scroll when the menu is open? Regards, Jamie.

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

    This developer is a good teacher. He explain things in a way people will understand.
    👍5🌟⭐⭐⭐⭐

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

    wow! great job!! Love it New Subscriber!

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

    This really helped me out and taught me a lot, thank you! I'm doing the Odin Project and will eventually get to this stuff, but I needed to do this for a friends portfolio site now.

    • @JsAcademyOfficial
      @JsAcademyOfficial  Год назад +1

      Sounds amazing, keep up the good work

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

      @@JsAcademyOfficial thanks, I was able to use the same principle to turn a 3 column grid into a one column grid with media query as well.

  • @DumbleCash-
    @DumbleCash- Год назад

    What program are you using in The beginning of The video to preview your website with different widths?

  • @Gamerz.280
    @Gamerz.280 2 года назад +1

    Could someone please help me, I'm using the same code, but I'm trying to center the product Home and about, but I'm not sure how to do it.

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

    thank you so much you helped me a lot !

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

    awesome!!!!! Thank you as much as whole galaxy :)

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

    Great video!

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

    Thanks for teaching ❤❤❤❤

  • @2GFactFinder
    @2GFactFinder Год назад

    Beautiful.

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

    Hi Adam, first of all thank you for your video. I've tried to do the same as you but when I run mobile version the menu disappears (neither the hamburger menu image appears). I have exactly the same code as you, do you know how to fix it?
    Regards, André

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

    Thanks bro🙂

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

    how do i make it so that is is visible on every page without having to copy the whole code?

  • @mspencer3674
    @mspencer3674 2 года назад +1

    this looks amazing!
    Educational and a fun thing to try as always sir.

    • @JsAcademyOfficial
      @JsAcademyOfficial  2 года назад +1

      You’re welcome :) Give it a try this weekend :) Also there is an online playground link in the description where you can play around in the code. Happy hacking!

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

      @@JsAcademyOfficial that’s great!
      I’ll try it tomorrow as i’m heading to a wedding this afternoon.
      Gotta say, your content is amazing!
      Keep it up!

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

    The query to hide desktop nav is not working for me. Please help.

  • @KaiBuskirk
    @KaiBuskirk Год назад +1

    Did you happen to do follow up videos for footer , content and pages… I was looking but did not find.. thank you for such great teaching will look into more as I learn Danke!

    • @JsAcademyOfficial
      @JsAcademyOfficial  Год назад +2

      Hi!
      Unfortunately not yet, because this year was really busy for me but I plan to continue content creation at the end of this year :)

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

      @@JsAcademyOfficial super! Thank you….
      I’m new finally after years of trying to follow and learn…
      Marriage Work Business Kids all get in the way of personal growth…fast forward 30 years later… I’m on the lookout for people that can teach an old dog a new trick! Lol….
      You got the Header thing nailed
      And explained it in a manor that helped me understand… building while doing… watching it change live helps ! Thank you ! looking forward to my new subscriber status! Cheers! Kai

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

    Are you creating the hamburger icon in this with the bars? I cannot get mine to show up or did you import an icon? Thanks!

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

      He made it by styling the three divs with the classes of bar1, bar2 and bar3. Shout me if you need help

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

    Thanks

  • @tothemaxguy
    @tothemaxguy 2 года назад +1

    Hi ! Nice tutorial. I have a question though. Where is the " .open " class?

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

      I had the same question but figured it out, he used classList in index.js to add the .open class to the menu element

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

    Hello! i am learning css and i was wondering wich one will the best way to make a nav bar and after a long research and tests u win by far using this method with flexbox i.thank you for the dedication and high quality content.

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

      You’re welcome :) I’m glad you found it useful :)

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

    For some reason the hamburger icon are 3 square block, what did i miss??

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

    Awesome brother 🙏🙏🙏
    Love from india 🇮🇳

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

      Thanks for the kind words!
      Love from hungary

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

      @@JsAcademyOfficial
      Keep it up
      Design different-different beutiful webpage ..🙏

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

    Brother very ver nice.
    I want to use it in my website, so can i use it freely or i have to take some license.
    I really liked it.😍

  • @Shivamgupta.webdeveloper
    @Shivamgupta.webdeveloper Год назад

    Aapne kaha se or konsa course Kiya hai

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

    do you parallax combine reponive bar video ?

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

    sir can you teach me full stack devlopment

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

    Amazing in the whole of RUclips same tutorials without anyone really using in a min width to start media query is this how developers actually think???

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

    Let me ask you please. I have a one page portfolio website that has links to various part like header, profile and contact sections. All these sections are id. everything works well on desktop screen, but when I click on any menu item link when the mobile hamburger menu is clocked open, the link will appear, but the menu bar will not disappear. Please 🙏 help me out. I used JavaScript to trigger the open and close of the menu bar.

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

    I've had an issue where if I try to add any content to the page, the mobile-bar disappears behind it. How could I fix it

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

      Hello! 👋
      From ehat you wrote I think that you need to add a z index to the mobile menu:
      developer.mozilla.org/en-US/docs/Web/CSS/z-index

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

      @@JsAcademyOfficial Yeah, found the fix, right after writing the comment, haha. But thanks for the immediate response from your end!

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

      No worries buddy!

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

      @@mitko746 how u fixed it? please tell me if u see this message

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

      @@allex5723 just use what @JavaScript Academy told me already, use z-index: 1; for an example and anything in front of the mobile menu could be z-index: 0; if it's still not working

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

    Came here just to check if im doing it right :D

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

    Hi, My js code is not working, it is doing nothing ??

    • @JsAcademyOfficial
      @JsAcademyOfficial  Год назад +1

      Make sure you included the js file properly. You can refer back to my example code that you can find in the description

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

      @@JsAcademyOfficial it worked , thankyou so much

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

    doesn't work for me..

  • @Smurfis
    @Smurfis 3 месяца назад

    This hierarchy doesn't allow the user to use the body anymore that is something you have to be aware of.

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

    it didnt work thank you

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

      It definetely should work. Please check the source code in thedescription

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

    dont waste your time to watch this video... just run source code, even you didn't get output...