JavaScript - How to Create a Responsive Hamburger Menu with HTML, CSS, & JavaScript

  Рет қаралды 278,743

Web Dev Tutorials

Web Dev Tutorials

Күн бұрын

In this tutorial, you'll learn how to create a responsive hamburger menu using HTML, CSS and JavaScript.
Sponsor me on GitHub!
github.com/spo...
Follow my blog:
/ miguelznunez
Email : mignunez@csumb.edu
Medium : / miguelznunez
Codepen : codepen.io/mig...
GitHub : github.com/mig...

Пікірлер: 316
@mary-hu3ff
@mary-hu3ff 2 жыл бұрын
One of the best tutorials I have seen up until now in JS for a simple dynamic! Even tho it's a simple topic, some people over complicate their tutorials so much, thank you!!!
@teenytinytoons
@teenytinytoons 2 жыл бұрын
Literally the best hamburger tutorial out there hands down. Took me forever to find one where I could understand. Bravo!!
@tmm476
@tmm476 3 ай бұрын
stfu its not
@naidenlambev4929
@naidenlambev4929 2 жыл бұрын
Hello and thank you ! This has helped me a lot. By far the cleanest tutorial and the best explanation. Thank you for giving us such a powerful content. Cant wait to see more from you !
@edwardwilson4272
@edwardwilson4272 2 жыл бұрын
I agree, I've looked at a few others and this is the best one so far. Really useful JS concepts in here too. Thanks Codefoxx!
@evelyntelevision
@evelyntelevision 2 жыл бұрын
Thanks for this! I searched all over for a simple, straightforward tutorial on making a collapsing navbar/hamburger menu like this, and yours is the best! I appreciate you getting straight to the point.
@jessicalopez6121
@jessicalopez6121 6 ай бұрын
😅😅😅😅😅😅😅
@jamesdeske4327
@jamesdeske4327 Жыл бұрын
Of the 1 million Menu tutorials I have seen this is the BEST
@codefoxx
@codefoxx Жыл бұрын
🙂
@vendettamalize7209
@vendettamalize7209 2 жыл бұрын
Thanks you saved my life from hamburger hell, from now on you're my master you have my subscription.
@urosmalic7818
@urosmalic7818 2 жыл бұрын
This with hamburger and adding spans blew my mind till now i was just adding font awesome icons, this sure teaches u that you can do awesome things with only basics
@T25de
@T25de 2 жыл бұрын
very true
@BryantCobarrubias
@BryantCobarrubias 2 жыл бұрын
Great demo. I adapted this for my react site. Adding comment to boost your YT algorithm. :)
@codefoxx
@codefoxx 2 жыл бұрын
Awesome and than you
@T25de
@T25de 2 жыл бұрын
boost boost
@ashwinsaxena4734
@ashwinsaxena4734 3 ай бұрын
The best video to make a responsive nav bar. Thanks for the video!
@adam3720
@adam3720 Жыл бұрын
In case anyone encounters an error with the JavaScript code not working, remove the script tag inside the tag and add it inside the body right before the tag. That way, the javascript code will be executed after the HTML Document has fully loaded. Your welcome!
@baazigar5
@baazigar5 Жыл бұрын
Just use "defer"
@inakristinethoresen1003
@inakristinethoresen1003 Жыл бұрын
Yup, that fixed my problem! Thank you!
@trillionairemania7750
@trillionairemania7750 Жыл бұрын
hey bro in my case its not working . can u help me with that
@trillionairemania7750
@trillionairemania7750 Жыл бұрын
@@baazigar5 hey bro in my case its not working . can u help me with that
@baazigar5
@baazigar5 Жыл бұрын
@@trillionairemania7750check your js file name
@berndberndo9581
@berndberndo9581 Жыл бұрын
My Hamburger Menu isn‘t working can anyone help me ?
@JhonnyBueno
@JhonnyBueno 2 жыл бұрын
My guy, you helped me a lot in javascript, I had a problem with my Responsive Menu, I thank you immensely, because I solved my case, congratulations for the video.
@henriquepinheiroxavier
@henriquepinheiroxavier 2 жыл бұрын
Thank you very much. Your video was the only one that I understood. I spent my entire weekend trying to learn this menu burger and could not understand it. Your video taught me!
@codefoxx
@codefoxx 2 жыл бұрын
Anytime, im glad i could help
@rulleywanjau6498
@rulleywanjau6498 2 жыл бұрын
Thanks these has been a very educative tutorial,has helped me as a student doing computer science ,simple brief and direct to the point
@HikerMike28
@HikerMike28 Жыл бұрын
So the hamburger menu button isn't even displaying for 😅😩 any ideas on what to do it's driving me crazy
@viveLaCifte
@viveLaCifte Ай бұрын
This was an amazing tutorial, thank you.
@Coco-ii2pu
@Coco-ii2pu Жыл бұрын
Thank you sooo much. Been troubling myself with bootstrap all this while when I could have just made mine. This tutorial helped a lot ❤️
@JC-hb2ob
@JC-hb2ob 2 жыл бұрын
Thank you very much for this tutorial. I am a beginner and it was really well explained which makes it easier to understand.
@kunoichikun
@kunoichikun 2 жыл бұрын
thankyou! was able to incorporate into my existing code easy and now everything looks so much cleaner to what i was doing before!
@codefoxx
@codefoxx 2 жыл бұрын
No problem, I got you
@superrnaah
@superrnaah Жыл бұрын
was trying to figure out the js to close the hamburger on link click and found it in this video. Thank you!
@giulia6930
@giulia6930 6 ай бұрын
Thank you, clear and step by step explanation. I was looking for this!❤❤
@jmid6358
@jmid6358 2 жыл бұрын
hi, great tutorial, nicely explain. but I've got a little problem. nothing happens when I click the burger button. I checked the code and everything seems to be right. it just doesn't do anything. any advice?
@vojtechsapousek1349
@vojtechsapousek1349 2 жыл бұрын
same
@alkanpone
@alkanpone 2 жыл бұрын
Hi, open your website in Chrome and press F12, there you can see logs. If the button doesn't respont i rec you look at the Action Listener part. Hope it helps :)
@xt0ferx
@xt0ferx 2 жыл бұрын
that was happening to me, I moved the javascript call to the end of my html file and it worked fine after that
@favourewulo5358
@favourewulo5358 2 жыл бұрын
@@alkanpone what should i do to that part
@gamechangers6946
@gamechangers6946 2 жыл бұрын
Same issue with me
@tomcox8801
@tomcox8801 Жыл бұрын
This was a great tutorial. I was looking for a simple way to add a hamburger menu and this was perfect. Nice and simple and clean. Thank you.
@codefoxx
@codefoxx Жыл бұрын
Absolutely
@yankeesfan3961
@yankeesfan3961 Жыл бұрын
If you don't know Java Script at all then you are in trouble, but it's very good to a point.
@UrCristiano-x8v
@UrCristiano-x8v 2 жыл бұрын
The best js tutorial that i have ever seen, thanks bro.
@mahdigholami3916
@mahdigholami3916 Жыл бұрын
Greet tutorial, simple and clear.. many thanks for what you are doing man!
@codefoxx
@codefoxx Жыл бұрын
I appreciate it 🙏
@ravitejadarla3882
@ravitejadarla3882 2 жыл бұрын
I ever seen this kind of clean explation video you made my day, but only thing we need to look into it when we have menu-links than we unable to scroll up & down I request you to check that please make a video on huge menu navigation bar sir....
@KozenDGray
@KozenDGray 2 жыл бұрын
Yo man great tutorial, best one i've found so far.
@leroymokobi2928
@leroymokobi2928 Жыл бұрын
Very simple, clear and straight forward. Yhanks a lot
@oppai.dragon
@oppai.dragon 2 жыл бұрын
Dude all done but in mobile menu i found the transparency.....my hamburger menu is transparent even though i have set background but the down home section items overshadowed it
@jagannathps
@jagannathps 2 жыл бұрын
If i saw this video earlier it could have saved a lot of time
@enssahfayiamomoh8410
@enssahfayiamomoh8410 Жыл бұрын
This video is very insightful... thank you a lot...I have learned so much from the video
@nnejiben
@nnejiben Жыл бұрын
This video is awesome and so helpful! Little wonder it came tops in my search result.
@bd-webtutor
@bd-webtutor 2 жыл бұрын
Thank you very much. I was struggling to make my navbar responsive, your video has helped me a lot. It was very easy to follow.
@trevormadden4301
@trevormadden4301 2 жыл бұрын
Cheers man. Nicely put
@edbarr1379
@edbarr1379 Жыл бұрын
With the JS file I had to change nav-Menu class to navMenu for the mobile menu to work, and for the class .navbar, use justify-content: space-around, worked best for me to avoid adding padding. Overall great Vid, helped me to get my boiler plate with nav included, now I just change the CSS variables to modify the colors.
@spicydoge3847
@spicydoge3847 Жыл бұрын
Great video. With some modifications to the code you presented in the video I was able to make a responsive dropdown style menu.
@andersrammbraten5708
@andersrammbraten5708 Жыл бұрын
what kind of modifications, if you would like to share? mine's not working
@francescaivonnetipianiolor7988
@francescaivonnetipianiolor7988 11 ай бұрын
mine's not working too :( @@andersrammbraten5708
@elvirakopstala6519
@elvirakopstala6519 2 жыл бұрын
Thank you! This was super helpful.
@LightJackKirin
@LightJackKirin Жыл бұрын
Splendid video!! Kudos to you mahn. 😮😅
@RL-rt6up
@RL-rt6up Жыл бұрын
great, thank you very much! slim and concise explained without any bells and whistles. however, it only worked for me when I prepended addEventListener with the argument DOMContentLoaded. before that it didn't recognize hamburger. i am very happy to have my own "plugin" for my websites now.
@wawananggana5129
@wawananggana5129 2 жыл бұрын
Simple and straight tutorial.. thank you..
@SeleDreams
@SeleDreams 2 жыл бұрын
I recommend to not use pixel units, it's better to rely on em and rem
@codefoxx
@codefoxx 2 жыл бұрын
Ok
@NiceChange
@NiceChange 11 ай бұрын
Thus is some great resources. Great work!!!!
@Firzj
@Firzj 2 жыл бұрын
thank you for the JS hamburger code (to close it when clicking links) I'm total noob but i finally made my hamburger menu work as intended 👍👍👍
@fannienatourz
@fannienatourz Жыл бұрын
Thank you so much for this tutorial! This was a life saver. Trust me!😅
@ПетрРусских-м3ь
@ПетрРусских-м3ь 2 жыл бұрын
Спасибо, все получилось лайк
@kzhang3835
@kzhang3835 5 ай бұрын
Thank you so much. This really works. 👍
@muhammadakram1701
@muhammadakram1701 4 ай бұрын
The best tutorial
@JurgenGeitner-s3r
@JurgenGeitner-s3r Жыл бұрын
Thank you so much for a brilliant tutorial!
@3reinaldo
@3reinaldo Жыл бұрын
Easy, and clean, thanks its a great tutorial
@spiritualforce
@spiritualforce Жыл бұрын
Damn! You made this look a cake wake for us. New subscriber bro!!
@rakibhasan9401
@rakibhasan9401 2 жыл бұрын
Thanks man! I appreciate your all the efforts buddy! you cracked complicated matters in the simplest way. #respect
@prashantmishra5691
@prashantmishra5691 5 ай бұрын
Great stuff. Subbed!
@Larsson037
@Larsson037 Жыл бұрын
i get the x animation when pressin it but the menu wont show up, help please.
@jakob6123
@jakob6123 Жыл бұрын
Solid tutorial
@vagabondideas9685
@vagabondideas9685 Жыл бұрын
Excellent! Thank-you
@_heyise
@_heyise 11 ай бұрын
This is very helpful. Thank you for this!!
@vurra
@vurra 4 ай бұрын
great video. everthing worked out fine except for one problem. when i have my menu collapses and i click on the hamburger menu to open it, it only shows the home link and not all the other links
@ff0x
@ff0x 2 жыл бұрын
Thankyou so much for this. You've earned another subscriber - great video :)
@Salio_Mendes
@Salio_Mendes 2 жыл бұрын
Man thank you so much. this has really helped me. ❤
@thehiddenjonin125
@thehiddenjonin125 2 жыл бұрын
I thought I would try coding out but after spending hours watching rewatching and reading all the comments and it still doesn't work idk if I can do this. The navigation bar doesn't come up hamburger doesn't work
@uchiha6622
@uchiha6622 Жыл бұрын
Any solution
@xanny3690
@xanny3690 2 жыл бұрын
Good tutorial man 🖤
@vikisneakers
@vikisneakers 10 ай бұрын
What a wholesome tutorial, everything worked smoothly sir
@Justhue
@Justhue 10 ай бұрын
Thank you this is so helpful
@Bigkcee
@Bigkcee Жыл бұрын
Thanks for the video it really was helpful
@МарияВоробьева-ш9к
@МарияВоробьева-ш9к 2 жыл бұрын
Hi, thank you very much! This video really helped me!!!!
@codefoxx
@codefoxx 2 жыл бұрын
I got you
@anuragkumarverma
@anuragkumarverma Жыл бұрын
can't run its shows error "Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')"
@theshelbypalace
@theshelbypalace Жыл бұрын
this is great video! thank you sooooo much!
@mcpeko
@mcpeko Жыл бұрын
Great stuff. Subscribed. 🍻
@hajarahmed304
@hajarahmed304 Жыл бұрын
thank you so much! this helped a lot
@microhandsltd
@microhandsltd 2 жыл бұрын
A great video, I thank you. I'm studying IT at University and this has inspired me to go that extra bit.
@PrinceSharma-gq5is
@PrinceSharma-gq5is Ай бұрын
Very Useful
@milanmegens4681
@milanmegens4681 5 ай бұрын
Great tutorial!. However, If i add new li's for more options my burger menu disappears. Could you help me?
@aminul.islam.
@aminul.islam. 7 ай бұрын
amazing. thank you
@Aalii6
@Aalii6 Жыл бұрын
very helpful, thank you!
@azizrahman3225
@azizrahman3225 2 жыл бұрын
Very simple other devloppers made this very complicated.
@GabbyBrucebru
@GabbyBrucebru 2 жыл бұрын
Thanks for your tutorial it help me
@psykhout
@psykhout 10 ай бұрын
Hi my hamburger icon disappears when viewing on mobile device. Please help
@Yunhaisongtao
@Yunhaisongtao 2 ай бұрын
Hey I got into a problem, after i did the @media breakpoint, the whole navbar won’t show up when page is wider than the breakpoint, what could I do wrong? After the breakpoint, the hamburger appears and everything works like a charm. Thank you!
@CjuianDesigns-wo1oz
@CjuianDesigns-wo1oz 7 ай бұрын
This worked letter for letter all the way until I got to the media quary to create the drop down .nav-menu. Then the whole hamburger just disappears. I'm so frustrated. I have tried 7 or 8 nav but the same issue keeps happening. I think it's Dreamweaver because it's so glitchy. any workarounds.
@FenaxPvt
@FenaxPvt Жыл бұрын
at the normal resolution(desktop) i cant see the links there hamburger having them but normal screen with higher resolution haven't ANY SOLUTION PLEASEEE
@ИванВалдаев
@ИванВалдаев Жыл бұрын
Наш герой
@Ali-sb5wj
@Ali-sb5wj Жыл бұрын
hi, when i write "" in my html file, hamburger menu is broken why??? 😥
@jeanbaptistedaryl1307
@jeanbaptistedaryl1307 2 жыл бұрын
if i could relike your post i would man awesome tuto
@adrianCoding
@adrianCoding Жыл бұрын
Thanks good tutorial
@JimKernix
@JimKernix 2 жыл бұрын
Excellent!
@bLitzKinG20
@bLitzKinG20 2 жыл бұрын
Thanks bro! Liked & Subbed.
@NashiEXC
@NashiEXC 2 ай бұрын
Hi, quick question, how would you make it move in from the right instead of left? i tried changing the Left:0; in the css to Right:0; and it just doesn't show up
@myclassroom1649
@myclassroom1649 2 жыл бұрын
Thanks you so much you made my day
@farukweb
@farukweb 2 жыл бұрын
excellent tutorial.
@ChromaticaCitizen
@ChromaticaCitizen Жыл бұрын
Bro this was so simple and every one of my Professors made it so difficult to understand 💀
@BurhanHasan-u9c
@BurhanHasan-u9c 3 ай бұрын
Hey how can I chnage its transition from topto bottom
@josipjak
@josipjak Жыл бұрын
Hamburger works great when my page are open in minimize screen, but when I return page in full screen navbar disappear. Help?
@peaklegacy146
@peaklegacy146 Жыл бұрын
I have my nav items come in from the top instead of the left. How should I go about making the Items transition from behind the header. It all works well now but its infront of the header for just a second
@abumdnayeemkhan7211
@abumdnayeemkhan7211 2 жыл бұрын
Very helpful video
@Brightangel001
@Brightangel001 Жыл бұрын
Thanks!
@codefoxx
@codefoxx Жыл бұрын
Absolutely, thank you !
@seand6906
@seand6906 2 жыл бұрын
Bravo!
@PRINCEDAKSHWEB_WIZARD
@PRINCEDAKSHWEB_WIZARD 11 ай бұрын
Thank you bro
@mithilakaluarachchi1
@mithilakaluarachchi1 Жыл бұрын
Hi, my code runs 1 perfectly and now it gives the error " expected identifier instead saw 'const'. please help
@jamesenrique648
@jamesenrique648 2 жыл бұрын
Wow, it works! Gracias✌
Create a clean, modern navigation with HTML & CSS
25:17
Kevin Powell
Рет қаралды 152 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,8 МЛН
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,9 МЛН
Responsive navbar with mobile hamburger menu | HTML, CSS, JS
40:06
Create a responsive navigation nav with no JS!
44:13
Kevin Powell
Рет қаралды 474 М.
Build a Slide out Hamburger Menu with HTML, CSS & JavaScript
16:27
Tyler Potts
Рет қаралды 115 М.
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 128 М.
Responsive Navigation Bar Tutorial | HTML CSS JAVASCRIPT
35:05
developedbyed
Рет қаралды 1,4 МЛН
How to build an accessible hamburger menu with HTML, SCSS & JS
13:25
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,7 МЛН