How to create a Responsive Navigation Bar (for beginners)

Поделиться
HTML-код
  • Опубликовано: 3 июн 2023
  • 👉 Get the best web hosting to deploy your websites: www.hostinger.com/coding2go
    ✌️ Use our discount code CODING2GO to get 10% off on all web hosting packages with a duration of 12 months or more
    👌 Check out our HTML & SEO course on udemy: www.udemy.com/course/coding2g...
    Source code on our website 👉 www.coding2go.com
    In this video we are going to create a responsive navbar together. I am going to explain everything you need to create a responsive navigation bar with a hamburger menu and a sidebar with a close button using HTML, CSS (Flexbox) and JavaScript. You will learn basic DOM-Manipulation with JavaScript and how to use CSS Flexbox to align your navbar horizontally and vertically (as a sidebar).
    #responsive #navbar #javascript #webdevelopment
    background image: unsplash.com/photos/m_HRfLhgABo
    google icons: fonts.google.com/icons
    CONCEPTS YOU WILL LEARN:
    ✔ HTML, CSS, JavaScript
    ✔ Responsive Webdesign
    ✔ Flexbox Layouts
    ✔ Media Queries
    ✔ Google Icons (Hamburger Menu, Close Button)
    ABOUT THE NAVBAR:
    The basic Navbar is created in HTML and CSS
    To make it behave differently depending on the size of the device that the website is being displayed on, we have to make it responsive. In the mobile view most of the links are hidden and accessable by clicking on a menu button (hamburger menu icon). It will expand a sidebar that uses CSS Flexbox to align the navigation links vertically. The sidebar has also a glassmorphism design to make it look like glass using the backdrop-filter property and the blur() method. To open and close the sidebar, we use google icons menu and close X. Using simple JavaScript DOM-Manipulation and the onclick Attribute of the Icons we can open and close the sidebar.
    RESOURCES for better understanding:
    HTML Tutorial: • Learn HTML in 15 Minutes
    CSS Tutorial: • Learn CSS Basics in 10...
    FLEXBOX Tutorial: • CSS Flexbox Tutorial f...
    GLASS Effect: • Create a glass effect ...
    like and subscribe if you read this 👍

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

  • @coding2go
    @coding2go  2 месяца назад +7

    Hey there, the source code for the project is available on our website
    👉 www.coding-kurzundknapp.com/coding2go.html

  • @shingieplays8745
    @shingieplays8745 2 месяца назад +14

    this is by far the best tutorial for a navbar on the internet

  • @user-dx6gz2bs1d
    @user-dx6gz2bs1d 3 месяца назад +7

    Bro you just saved me I've been searching for videos explaining what you just did and yours is by far the best thanks bro

  • @25Manzambi25
    @25Manzambi25 26 дней назад +2

    Finally a great tutorial where you just go straight to the point.

  • @princearya4208
    @princearya4208 10 месяцев назад +13

    VERY CLEAN & TO THE POINT VIDEO.

  • @saddamwassan897
    @saddamwassan897 4 месяца назад +6

    you've defined it very smoothly and clearly thanks man.

  • @memoryclips.moment
    @memoryclips.moment 5 месяцев назад +9

    This tutorial is the best of i have seen on this topic you are relly great at teaching be consistent you will be the one of the best teacher out there i relly appretiate👍

  • @bisaanimations
    @bisaanimations 13 дней назад +1

    I've watched a few tutorials on learning various responsive design projects, like navbars, websites, forms etc.....this is by far one of the best i have seen. I shall definitely be learning more from your videos in the future! Thanks for being so clear and easy to follow/understand.

  • @mike-480
    @mike-480 3 месяца назад +1

    Really good. I always wanted to fully understand how this was done at the basic level. And your teaching is great. Not done on the fly, but every word fully scripted out perfectly with no mistakes.

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

    Thanks! you saved me a bunch of time and It finally clicked for me how html/css utilizes javascript.

  • @triviahaven2853
    @triviahaven2853 3 месяца назад +9

    Thank you for this tutorial. I've been searching for the easiest way to integrate this hamburger menu in my website. Now, I was already able to to it as simple as that. Thanks again. You deserve a subscribe!

    • @shanuanxari2216
      @shanuanxari2216 3 месяца назад +1

      I watched a lot of videos but this one ❤❤❤

  • @user-mb4hw7wt7i
    @user-mb4hw7wt7i 7 месяцев назад

    Thank you so much!
    This is the video that gave me the proper explanation

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

    thank you so much. i had a problem of horizontal scrolling. now its solved

  • @Lavenderfields1723
    @Lavenderfields1723 7 месяцев назад +4

    Very very nice! I found it really useful for me. Thank you so much!

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

    supper excellent sir. i scrolled down the whole youtube but didn't get video like this. Really amazing. love from pakistan

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

    This is fantastic, its simple and easy to follow, thank you so much!

  • @droneit7961
    @droneit7961 4 дня назад

    cant leave without saying thankyou!

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

    you should keep making these videos bro
    i've never seen anyone else explain things this cleary

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

      his explanation is good and understandable

  • @user-fj9un8uc7z
    @user-fj9un8uc7z 28 дней назад

    The best navbar tutorial

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

    The best tutorial so far❤❤❤

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

    Thank you for this tutorial, instead of using bootstrap this is the best alternative.

  • @dimitryngayo9455
    @dimitryngayo9455 3 дня назад

    Thanks for the video really helpful,I have been searching for where someone is gonna explain responsive on nav bar🙏. Thanks once more

  • @razarajpoot9811
    @razarajpoot9811 7 месяцев назад +1

    Thank you very much for great explaination

  • @user-lc9uq3ey5m
    @user-lc9uq3ey5m 2 месяца назад

    Absolutely insane . It was quite easy to understand ❤❤❤❤

  • @mhathunggeorge8082
    @mhathunggeorge8082 22 дня назад

    Amazing tutorial..just the video I was searching for. Thank you so much.

  • @tutoro5567
    @tutoro5567 4 месяца назад +2

    Great video. You are talented in explaining. Keep going, I believe you will have many followers )

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

    Watched so many videos about this and only this one worked.

  • @Marceloamado1998
    @Marceloamado1998 14 дней назад

    Thank you very much this was exactly what I was looking for!

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

    thank youuu this really helped me a lot!!!

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

    the key thing is you are talented in explaining.

  • @easywebsolution7044
    @easywebsolution7044 9 дней назад

    Thanks, very easy to understand. it save my time

  • @muhammetciviler1445
    @muhammetciviler1445 5 месяцев назад +1

    Thank you. Its perfect, good job

  • @CityGalleryIND
    @CityGalleryIND 13 дней назад

    Thank you man ❤

  • @edokpolorjohn2121
    @edokpolorjohn2121 7 месяцев назад

    Nice one.

  • @noshamezmez288
    @noshamezmez288 28 дней назад

    thanks for ur effort ,i always have a problem how to make navigation bar responsive but now it become easy for me =D

  • @xRuds
    @xRuds 2 месяца назад

    Thank you. Looking for Admin Dashboard tutorial for next videos! You deserved a subscribe! Thumbs up! 👍🔥💯

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

    It really helped me, I pretty need this tutorial that much, thank you bro

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

    Yes I did with you ❤ my first tutorial to watching easily thanks man great job
    Please make lots video to others topic .

  • @godwinoyale3550
    @godwinoyale3550 5 месяцев назад

    Best tutorial ever.

  • @M_H_Cricket
    @M_H_Cricket 5 месяцев назад +1

    thank you so much. Wonderful tutorial

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

    Very informative. I subscribe thanks to you man. Keep uploading videos it's a great help

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

    I love this video
    Thank you so much

  • @Black_30-ur2ew
    @Black_30-ur2ew 2 месяца назад +1

    Thanks Brother.

  • @TirthJoshi-qy8mv
    @TirthJoshi-qy8mv 25 дней назад

    Very Useful!! Thanks

  • @angelolobascio6608
    @angelolobascio6608 23 дня назад

    Fantastico...bravissimo 😉

  • @richardmerks1344
    @richardmerks1344 Месяц назад +1

    Your explanation of this tutorial is fantastic, I edited my website while you where showing each step, pausing as needed to check my work and everything fell into place as it should.
    Strangest thing though, I use notepad to edit the code and Firefox to view the changes (as I always do) and had no issues, uploaded the files to my website host and check the live version on Firefox (my usual browser) and yes it is up to date, the links where all sitting over to the left with bullet points the "hamburger" and the "X" sitting on top and bottom of the links, very weird! lol.
    I check my site on MS Edge on my laptop, Firefox and Safari on my iphone and it all worked great, Even weirder!
    I'm sure there has to be a string of code that will allow FF to view my site as it's intended?
    I initially was looking for a floating anchor tag that took my page to the bottom where my links are but when I saw this, that idea went right out the window, this nav menu is far more professional, Thanks for all your hard work.

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

    THANK YOU A LOT

  • @muhammad_zohaib936
    @muhammad_zohaib936 2 месяца назад

    Thanks sir 👍❤

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

    This is great, thank you

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

    Very nicely done. For this cool navbar to be persistent across pages is it fair to assume it will be in a ?

  • @CodeXtream
    @CodeXtream 3 месяца назад +1

    I know English little bit but your explanation is awesome 😎😎

  • @HowToSandAFloor
    @HowToSandAFloor 4 месяца назад +1

    omg this is exactly what I wanted 😂 thank you

  • @alanali9645
    @alanali9645 2 месяца назад

    thank you brother

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

    Thank you very much. Would be wonderful, if you would make a similar on with multilevel dropdown menus

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

    شكرا Thanks it was helpful

  • @randomlol472
    @randomlol472 12 дней назад

    Great video, thank you so much!

  • @akejeludavidojoshimite646
    @akejeludavidojoshimite646 4 месяца назад +1

    this was super good. Thanks

  • @RehaanHussain-xw5cy
    @RehaanHussain-xw5cy 2 месяца назад

    Thanks bro

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

    It helped a lot thank you 😄👏👏

  • @malekbzd8086
    @malekbzd8086 11 месяцев назад

    Thanks bro 🤝🦾
    Really good explaining !!

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

    Thankyou 🙇🙇

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

    Great tutorial....... explained very nicely

  • @user-xl5rx8ro1s
    @user-xl5rx8ro1s 2 месяца назад

    thank you

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

    This is indeed a very good tutorial

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

    thank you sir .. you saved my life
    what if i want the toggle menu button in normal aspect ratio also not only in responsive ratio

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

    thanks man, learned a lot

  • @user-iy4sr3qk2c
    @user-iy4sr3qk2c 2 месяца назад

    Thanks

  • @tabeshomari-ck9tf
    @tabeshomari-ck9tf 4 месяца назад

    that was great illustration bro

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

    Thanks so much......

  • @user-yk2fn9ow5t
    @user-yk2fn9ow5t 2 месяца назад

    Wow Nice!!! Thank you!!!

  • @aminalwamba2007
    @aminalwamba2007 2 месяца назад

    great explanation

  • @RobinSingh-wk8qv
    @RobinSingh-wk8qv 4 месяца назад

    Nicely explained ❤

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

    very well explained, i subscribe!

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

    clean and ez

  • @lenkadzn2951
    @lenkadzn2951 2 месяца назад

    thank you, such a great lesson for begginers.

    • @coding2go
      @coding2go  2 месяца назад

      Glad to hear you liked it 😊

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

    thank you for the video

  • @LalitKumar-ts5tq
    @LalitKumar-ts5tq 4 месяца назад +1

    Very nice explanation👍👍

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

    Thanks a lot!! 😊😊 Its Really usefull and easy!!! Please More JavaScript like that!! 😅😅😅 😂😂

  • @YashShah-dg2nw
    @YashShah-dg2nw 2 месяца назад

    Amazing😀

  • @bobbetsagnut
    @bobbetsagnut 20 дней назад

    Using display: none in the media query did not work until I added display: none !important. Not sure why but now it works

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

    Very very good expalnation keep it up

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

    Short and easy to understand if you’ve had a little prio knowledge with HTML, CSS & JS

  • @TH3G3N3S1S
    @TH3G3N3S1S 2 месяца назад

    Hello @coding2go i have a question.I made some changes to the css so that the sidebar is always visible and only when its in mobile-mode there is a hamburger menu. Now i want to put several boxes next to the navbar. But when i try that, the boxes are behind the navbar. What can i do to fix that? In the mobile version everything works perfectly, just the desktop version doesnt. Btw i really love the design of the navbar, the blurry effect looks really good!
    EDIT: well i kinda managed to make it on my own which i guess is better for the learning experience, but somehow the blur effect isnt working anymore... ok i did it xD

  • @saidabdelrhman1234
    @saidabdelrhman1234 16 дней назад

    Awesome 😊

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

    Super
    Thanks

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

    Thanks sir🙏❤

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

    Amazing

  • @aliuabdulmanaf353
    @aliuabdulmanaf353 5 месяцев назад

    GOOD!!!!!!!!!!!!!!!!!!!!!!!!!!! I love it

  • @Robert-gr1cl
    @Robert-gr1cl 7 месяцев назад

    great tutorial, it helped me a lot thanks

  • @rifathasan-pl7pn
    @rifathasan-pl7pn Месяц назад

    Great video

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

    First, I like your tutorial.
    Second, I have a question.
    @media (max-width: 800px) does not work on my phone. window.devicePixelRatio = 3.375, window.screen.width = 320, and the max-width breakpoint seems to be 1080.
    However window.devicePixelRatio can vary from one device to another. So how to write @media queries?
    Thank you!!!

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

    great tutorial

  • @HuiHuiiiiiiiii
    @HuiHuiiiiiiiii 2 месяца назад +1

    This is so good. But there's a problem, if you toggle the sidebar on small screen and start resizing screen, it won't automatically hide until you click on that cross button.

  • @ayanTheDeveloper
    @ayanTheDeveloper 5 месяцев назад

    that's a fine video.subscribed!

    • @coding2go
      @coding2go  5 месяцев назад

      Thanks! Welcome to this channel.

  • @TechnowulfTV
    @TechnowulfTV 14 дней назад

    Hi Thank you for the excellent responsive navbar tutorial! You make it look so simple. However Im having problems why when I refresh the sidebar appears even when it was declared display:none in the .sidebar css?

    • @TechnowulfTV
      @TechnowulfTV 14 дней назад

      I found the easier way heres the code just embed in your body tag and it will hide sidebar every time page refresh or loads :) Thank you!

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

    is any reason to put sidebar above main menubar links?

  • @fasteditsyt
    @fasteditsyt 2 месяца назад

    I enjoyed this video!

  • @user-zn5fc6mh1f
    @user-zn5fc6mh1f 3 месяца назад

    Hey is this code available for use? I'm learning however this is everything i need

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

    I dont like the tutorial! I LOVE it!!

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

    I thought this was great and followed, and understood, all except the svg code part at 9.04. This is something new to me and so I really didn't get how you rendered the items. I have downloaded the two items from the site you suggest. Hopefull you will be able to help me on this. Many thanks in advance.

    • @coding2go
      @coding2go  4 месяца назад +2

      I am glad that you like the video and I am happy to help you understand it better. The icons we have downloaded are svg files. An svg file is structured exactly like an html element. It has an opening tag and an enclosing tag . Therefore we can simply insert it into our HTML. It looks very complicated and long because the svg element has a lot of attributes. These attributes describe in the form of vector code how the icon should look like. We don't need to understand exactly how a vector path works because we can simply copy the code. To do this, you need to open the SVG file with a code editor and copy the entire svg element. Of course, we can also change a few of these attributes. The simplest attributes are "height" and "width", which we use to set the size of the SVG image. With the "fill" attribute you can change the color of the SVG. If we had used a normal PNG or JPEG image for the icons instead, we would not be able to change the color, which is why SVGs are better. But everyone can decide that for themselves. In CSS, we also used media queries to set the screen sizes and conditions on which the icons should be displayed. For example, the menu icon should only be displayed on mobile devices. We used JavaScript to code the functions that open and close the sidebar when you click on the li element that holds the SVG icon. I hope these explanations were helpful.

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

      Many thanks for that - all sorted now and looks good. Wish you all the very best. @@coding2go