Responsive navbar tutorial using HTML CSS & JS

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024

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

  • @spacemanstrikesagain
    @spacemanstrikesagain ปีที่แล้ว +61

    I found the Hamburger mobile navigation menu tough to grasp. I read multiple articles, played around with codepens, watched videos etc. This is the only video that explained the whole thing in a truly beginner friendly way. And I appreciate the effort that you put into it Mr. Powell. Kudos and millions of thanks ❤❤

  • @electronicbasics1856
    @electronicbasics1856 2 ปีที่แล้ว +81

    the tutorial everyone needed but no one asked for.

  • @aakashkathait8328
    @aakashkathait8328 2 ปีที่แล้ว +24

    I just completed you “conquering responsive layout” course , it changed my mind completely on how I see html and css. Thank you for such quality content for free

  • @Anth-ony
    @Anth-ony 2 ปีที่แล้ว +109

    Great video. I know you're the "CSS King", however, may I suggest that you create some very basic JS tutorials on the most common use-cases of said code? I've learned more about the basics of JS from you, as you touch on it in your videos, and how to implement them in my own projects than I have from people actually teaching straight up JS. You're very concise in how you create/explain those sections in your videos and I'm sure others would enjoy this as much as I would. Plus, it would be a bit of a change up for you to keep things fresh. Anyway, keep it up Kevin, you're one of my favourite TH-camr!

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

      +1 - things like how to add a secure login, etc; I know these will require databases, but not sure how to approach this problem

  • @steff9775
    @steff9775 ปีที่แล้ว +2

    Dude...i watch your videos for almost 1 year now. This is my first comm and I wanted to say that I just LOVE THE WAY YOU TALK.

  • @digitalalien3534
    @digitalalien3534 2 ปีที่แล้ว +20

    I just finished the full course on scrimba and it was GREAT. A ton of information on proper workflow and good practices, and lots of pointers on useful things I need to learn more about. I've been trying to get better at building complete websites (instead of small challenges like hovercards etc) and learn some JS along the way, and I was a little overwhelmed and sometimes felt lost as to where to start and what's important. But with this course the picture became much clearer. It was exactly what I needed, so thank you!

    • @LibraryOfTheOligarchs
      @LibraryOfTheOligarchs 10 หลายเดือนก่อน

      Where are you along in your journey now? Good at JS?

  • @CodeWithSahand
    @CodeWithSahand 2 ปีที่แล้ว +12

    The Navbar looks amazing. I like the idea.

  • @cemrekur5700
    @cemrekur5700 2 ปีที่แล้ว +50

    Great video , only problem that you may come across , you should also put visibility:hidden to nav-links to avoid tabbing over the screen and also to get around transition issues adding simple delay to transform can do the trick!

  • @yajirushik2871
    @yajirushik2871 2 ปีที่แล้ว +22

    6 months ago I wouldn't know how to do it, so I have subscribed to You. Actually I just have moved to end of video and after looking at final effect I can remake it from scratch. Thank You for the whole time which You are spending to teach us. Also still looking for front-end job but need to learn a lot more :D

  • @DanteMishima
    @DanteMishima 2 ปีที่แล้ว +2

    And you wonder why we call you king?
    How you knew this is what I needed is beyond me

  • @user-os4zb1wo6b
    @user-os4zb1wo6b ปีที่แล้ว +1

    This man is pure gold. The sheer number of informative videos on CSS instead of just blabbering is insane. Get this man a subscription.

  • @ZANES-YT
    @ZANES-YT 2 ปีที่แล้ว +2

    This guy us one of the best content based programming markup language course tutor ever, so much valuable content in the last 3 years from you thanks for helping me being the css designer I am now.

  • @Santino11238
    @Santino11238 2 ปีที่แล้ว +16

    Thank you, as a MERN stack dev I'm always looking to learn more styling. Appreciate the content.

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

    That's so cool that you take your time and explain things well like with a friend. Really enjoyable to watch.

  •  2 ปีที่แล้ว +1

    I can hear both hope and pleading in that sentence that 'Internet explorer is dead' :)
    Great video as always.

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

    Thank you Kevin. This video showed me most of the fundamental that I need to start up my responsive web. other vids does not really explain how exactly how its done so they doesn't teach anything lol

  • @oskrm
    @oskrm 2 ปีที่แล้ว +23

    One note, in chrome the backdrop-filter blur is very bad for large blur values, and you get edge bleed. What works better is to use an SVG blur with URL value.

    • @shoumikkumbhakar6375
      @shoumikkumbhakar6375 2 ปีที่แล้ว +3

      and firefox doesn't even support it

    • @oskrm
      @oskrm 2 ปีที่แล้ว +3

      @@craigburton4447 using it in backdrop-filter: url(#svgBlur)
      Would work as you would expect

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

      @@oskrm Ah sorry, I thought you meant it replaced the backdrop functionality, my bad.

    • @kevinwaag9976
      @kevinwaag9976 2 ปีที่แล้ว

      it's what I normally use as well

  • @Petahsaur
    @Petahsaur 2 ปีที่แล้ว +6

    Perfect timing Kevin,
    Just as I started to look into navbars and js last 2-3 days
    Thanks!

  • @CarlWicker
    @CarlWicker 2 ปีที่แล้ว +8

    I'm currently working on this project in ReactJS, great project with some interesting challenges. It's very handy to have the figma files.

  • @Yuri-qr7ml
    @Yuri-qr7ml 10 หลายเดือนก่อน

    So I started this tutorial a few months back as I thought it could be a fun project, got frustrated by the button for the nav not doing what it should be doing. Now my journey has only started earlier this year with little time but it seems that I had a . instead of a , in the js. So I wanted to come back and say, fantastic tutorial!

  • @abadlibadreddine1960
    @abadlibadreddine1960 ปีที่แล้ว

    I started following this guys 2 months ago, i can now say that i fell in love with CSS

  • @Pavel-wj7gy
    @Pavel-wj7gy ปีที่แล้ว +2

    Sometimes I get to do navbar, footer or any kind of layout components that I forget how to do. On those days, I come to Kevin Powell channel for ideas and you never disappoint! Truly a joy to watch someone as fascinated by CSS as you.

  • @mrCetus
    @mrCetus 2 ปีที่แล้ว +11

    This is so well explained. Love that you cover so many newer css properties, logical properties as well as best practices like aria. This is quality education.

  • @aymenfyi
    @aymenfyi 2 ปีที่แล้ว +19

    kevin, can't thank you enough for all the invaluable content you're consistently giving us. learning so much and enjoying every step along the way! ♥

    • @joshuasteed899
      @joshuasteed899 2 ปีที่แล้ว

      🤣🤣🤣

    • @aymenfyi
      @aymenfyi 2 ปีที่แล้ว

      @@joshuasteed899 what’s so funny?

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

    for the test you could also do `primaryNav.setAttribute('data-visible', visibility === "true" ? "true" : "false")`

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

      I think Kevin just wanted to be more explicit and show how it works to people who might not be so familiar with JS.
      But you are right, I used the ternary operators too as I like how short and sweet they are for basic conditionals.

  • @davidtaylorgarcia8556
    @davidtaylorgarcia8556 2 ปีที่แล้ว +5

    Certainly you are as good as a web-dev-youtuber can be. Your clarifications are awesome, your content is incredibly well structured, even your voice tone gets on really well with the content. Thx a lot!

    • @KevinPowell
      @KevinPowell  2 ปีที่แล้ว

      Thank you so much for the kind words!

    • @kuntrasha
      @kuntrasha หลายเดือนก่อน

      #kevinPowell {
      tone: inherit;
      voice-tone: currentTone;
      border-radius: 50%;
      }

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

    Mr. Kevin you teaches the beauty of of html css & js in beast mode .

  • @vavaiva4080
    @vavaiva4080 2 ปีที่แล้ว

    an answer for my misery… just had my class and i got a homework to do and this is a life saver… either God listen to my misery or my ipad tired to listen to my frustration…

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

    I am working on this project using scrimba platform
    Great course
    Doing this using reactjs
    Till now best course for me to learn design system 👍

  • @myfavoritemusic2428
    @myfavoritemusic2428 2 ปีที่แล้ว

    I just started my HTML CSS and JS studies and my first project is creating my own personal CV site.
    This will help A LOT with that. Thanks!

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

    🥺🤤🤤🤤🤤🤤thankssss your channel is blessings for us🥺🥺🥺
    I'm in super love with CSS 🤤🤤🤤🤤🤤

  • @trentturner1546
    @trentturner1546 2 ปีที่แล้ว +2

    Thanks for this tutorial Kevin. I’ve been watching you for a while and always enjoy learning from and watching you. This one helped me switch my default mobile navigation to use translate x instead of animating the left and right properties to show and hide my menus. A much better way of doing it. Thanks again.

    • @dev_ression
      @dev_ression 2 ปีที่แล้ว

      Kevin is fantastic

  • @TiagoSilva-sq4gp
    @TiagoSilva-sq4gp 5 หลายเดือนก่อน

    Man you are the bomb, i was almost giving up of programing but with your videos i finally got it, thank you

  • @ahooton
    @ahooton 9 หลายเดือนก่อน

    Kevin, I spotted something when implementing this in my project; if the mobile navigation is still in its expanded state, and the browser window is manually resized so that it passes into desktop view, then aria-expanded and data-visible will still remain set to 'true'. Additional JS logic can be added to ensure these attributes are set to 'false' if this scenario occurs.

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

    You reall are CSS-king just like Kyle said. I have learned alot from you, thank you!

  • @nof123
    @nof123 2 ปีที่แล้ว

    been learning css for 2 months and wow I learned alot from this vid

  • @lonelysock3746
    @lonelysock3746 ปีที่แล้ว +2

    Great video! However, I would've really liked to see you go over the sr-only class you made; I've run into some issues with my button and I believe it's because there's some more information I'm missing

  • @mirandasanchez4000
    @mirandasanchez4000 ปีที่แล้ว

    I’ve learnt SO much from this tutorial, it’s great to put knowledge into practice. Thanks! I wouldn’t mind watching a couple of ads if that help you whatsoever as a youtuber. Your content is priceless 😊

  • @nicolasnog26
    @nicolasnog26 2 ปีที่แล้ว +3

    Great video, you are inspiring me to get in more depth touch and play around with CSS instead of using already done templates for my projects!

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

    I was literally just looking for a video from you on this yesterday!! Did the responsive navbar on my own....time to see how bad I messed up ha thanks kevin youre the goat

  • @VitoOnYoutube
    @VitoOnYoutube 2 ปีที่แล้ว +8

    Is there any advantage in making the span for "Menu" instead of setting aria-label=”Open menu” directly on the button?

  • @AbdicateDotNet
    @AbdicateDotNet 2 ปีที่แล้ว +3

    As usual, a great, informative, and wonderful video!! 👏👏👏👏 Now I have to change my site! 😁

  • @markrobbins6985
    @markrobbins6985 2 ปีที่แล้ว

    Love your show, Babe. Had to chuckle at your admission of time wasted troubleshooting a file that wasn't linked. My bane is editing the HTML, CSS and Javascript but NOT saving all three.

  • @perkin524
    @perkin524 2 ปีที่แล้ว +4

    Oh Yes! What an excellent tutorial - you were on top form for this one Kevin. So helpful to see modern CSS rules in actual use cases like this where you can not only see how they work but also how they save time and effort.

  • @06011983daniel
    @06011983daniel 2 ปีที่แล้ว

    Thank you so much for sharing your knowledge. Even though I don't know how to speak English, I managed to understand the whole concept to reach your final goal.

  • @rishabkumar5656
    @rishabkumar5656 2 ปีที่แล้ว +2

    Hi Kev, this is one of the most easiest and well explained videos on youtube. Well done. Thanks for making it. 💖💖

  • @RayMaxey
    @RayMaxey 2 ปีที่แล้ว

    Niiccee, I have been using this Space project to incorporate the navigation into my project this past weekend. You knew that I got a lil stuck and needed a quick push.

  • @thinker-o5p
    @thinker-o5p 2 ปีที่แล้ว

    your videos are kind of a one stop solution. thanks for explaining so well

  • @dannyr2976
    @dannyr2976 2 ปีที่แล้ว +3

    Another great video! The site design and navigation looks so clean, I love it! Always learn a lot from watching your examples so thank you so much!

  • @noblekram
    @noblekram 2 ปีที่แล้ว +3

    i really like how you explain the details in a simple and understandable way! great tutorial Big Thanks

  • @waardal
    @waardal 2 ปีที่แล้ว

    My god just in time when i have to make a responsive portfolio as a school project, thank you so much!!

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

    Great lesson from a greater TechEducator

  • @ismailsossi3239
    @ismailsossi3239 ปีที่แล้ว

    you are a sweet person, thank you so much for trying!

  • @user-ir9dm3yx4o
    @user-ir9dm3yx4o 2 ปีที่แล้ว

    the design is just so clean and beautiful!! glad i found this, thanks for the video :D

  • @jacoblockwood4034
    @jacoblockwood4034 2 ปีที่แล้ว

    I'm glad you dropped the "madly, deeply in love with CSS" for just "in love with CSS." it just sounds much less.. invasive? I don't know, but I think it was a good choice.

  • @sheriffcrandy
    @sheriffcrandy ปีที่แล้ว

    This is a super awesome tutorial, with a couple caveats:
    1.) when the menu is opened and you click on one of the nav links to navigate to a new page, the menu stays open on the new page.
    2.) When window resizing, the menu suddenly opens and closes which I think is bad design
    3.) If you want to animate the hamburger icon from the three horizonal lines to an 'X' shape, you're going to have to rework the css since he is using an animation on an image.

    • @irinaka4351
      @irinaka4351 ปีที่แล้ว

      Could you tell me how can I get rid of this suddenly appearing menu when resizing the window? I've been thinking the whole day about it :((( Thank you!

    • @sheriffcrandy
      @sheriffcrandy ปีที่แล้ว

      @@irinaka4351 I had to re-work the css into a completely different implementation. Don't put the menu animation under the media query because you won't be able to prevent the menu from automatically appearing on page resize. Instead, make the menu appear or disappear on the hamburger button click using javascript. Use can use 'is-active' flags and toggle them on or off when the hamburger button is clicked with js and then use those in your css to manipulate the behavior.

  • @ibnulferdous2349
    @ibnulferdous2349 2 ปีที่แล้ว

    CSS from another planet! Loved it!

  • @alexanderdavin1655
    @alexanderdavin1655 2 ปีที่แล้ว

    It's really helpful explaining every attribute/property as you go along, thanks for that.

  • @StevenJGaming
    @StevenJGaming ปีที่แล้ว

    I love you Kevin. You are my secret mentor.

  • @Mohammadreza-Dolati
    @Mohammadreza-Dolati ปีที่แล้ว

    Sir , your videos are full of useful contents, thanks a for your helping, big ❤️ from Iran

  • @thtasca
    @thtasca 2 ปีที่แล้ว

    Oh man, I really need to upgrade my knowlege in css. A lot of atributes and selectors I'm not familiaryzed, I really stuck in time in some parts of front end ahuahuhauhaa. Your channel is so great, i'm not every time here but when I see one of your videos I'm always learn more, thx.

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

    Not sure why. But however on my end, the sr-only on the span from the button is not working. It is still visible on my chrome browser. Is there a reason why.. And do you guys have problems with it?

  • @JohnSnow-gi7iv
    @JohnSnow-gi7iv 2 ปีที่แล้ว

    New things I learned from this video :
    gap
    inset
    min
    @support
    aspect ratio

  • @aryan7069_
    @aryan7069_ 2 ปีที่แล้ว

    I just did first challenge time management UI . I m glad i was able to do it without figma files

  • @mevkok
    @mevkok 2 ปีที่แล้ว

    If you're going to use Javascript with a booleans for visibility just check if the attribute is there or not...
    if (primaryNav.hasAttribute('data-visible')) {
    primaryNav.removeAttribute('data-visible');
    } else {
    primaryNav.setAttribute('data-visible', true);
    }
    or something like that.. without actually adding it to the html..

  • @sssself
    @sssself ปีที่แล้ว

    You Are So Amazing Kevin!! Thanks for your existing👼

  • @ninopotskhoraia5373
    @ninopotskhoraia5373 2 ปีที่แล้ว

    These glasses look really good on you

  • @rheavictor7
    @rheavictor7 2 ปีที่แล้ว

    Kevin, thanks man. I'm really improving m y CSS skills with your content!

  • @raho2005
    @raho2005 2 ปีที่แล้ว

    holy cow, i learned a lot of new and interesting css features today. Thanks!

  • @Wynorrific1
    @Wynorrific1 10 หลายเดือนก่อน

    I love your work everything is so easy. I just love it, I thought you were the css king but really your the code king.🤴you make it very easy to follow and learn god bless you and please keep making content

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

    wait what, do you not have to close list item tags?

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

    There's no ending tag :(

  • @trungduchua1786
    @trungduchua1786 2 ปีที่แล้ว

    Thanks Kevin, this video helps me a lot! As an UI/UX designer who wants to expand his knowledge to manage his work better, this kind of easy-to-understand tutorial is really a gift!

  • @SrckyBoi
    @SrckyBoi 2 ปีที่แล้ว +2

    Cool video Kev. Just one correction, display: none doesn't remove element from the DOM, rather from the document flow. Keep up the good work.

  • @whoisitidk3980
    @whoisitidk3980 2 ปีที่แล้ว

    Thank you for sharing so many useful HTML, CSS, and JS attributes, it really helped me a lot

  • @antonkuchmii8048
    @antonkuchmii8048 2 ปีที่แล้ว +3

    Thanks for a cool video, but why don't you use the 'dataset' property of the element instead of 'getAttribute'?

  • @alex-suciu
    @alex-suciu 2 ปีที่แล้ว

    props for making this accessible

  • @kevinwaag9976
    @kevinwaag9976 2 ปีที่แล้ว

    really elegant way of doing this. Well done!

  • @sphinxz_gaming
    @sphinxz_gaming 2 ปีที่แล้ว

    I have been practicing the flex box whole right now 👍🏼

  • @Felipe-53
    @Felipe-53 2 ปีที่แล้ว

    Wow, this came out right in I needed it. Thanks, you're awesome!

  • @stephaniepeters1354
    @stephaniepeters1354 2 ปีที่แล้ว

    You could also just add/remove a CSS class with Javascript via classList.toggle(). I for one much prefer writing class selectors over attribute selectors. It also reduces the code in the event listener to a one-liner :) -> primaryNav.classList.toggle('.is-visible') (not counting the setting of the aria-expanded though, but that can also be simplified)

    • @KevinPowell
      @KevinPowell  2 ปีที่แล้ว +2

      Yup, I used to do that, but I find on bigger projects this is easier to maintain. When you have more people working on something, the more clear something is, the better, even if it's more lines of code. In this case, if JS is involved, data attributes are a pretty standard way of letting people know that 🙂
      If it was a personal project, I'll be toggling classes for sure 🙂

  • @luiscarloscorderopena7030
    @luiscarloscorderopena7030 2 ปีที่แล้ว

    I learned some very usefil tip watching this, thank you!

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

    Hey! Shouldn't the be closed by a tag?

  • @gabrielbaldez3178
    @gabrielbaldez3178 ปีที่แล้ว

    Excellent tutorial! Great things were taught and you explained in a very clear way.

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

    Dude 🥺🥺🥺🥺, i needed this sooo much

  • @cohdalton
    @cohdalton 2 ปีที่แล้ว

    Absolutely brilliant video, there's so much in it to go through and learn. Thank you, fantastic job!

  • @tmkdesigner
    @tmkdesigner ปีที่แล้ว

    Thank you so much for all of your videos! Im learning so much!

  • @GoldoMania.
    @GoldoMania. 2 ปีที่แล้ว +1

    Hello Kevin! i realy love what you are doing, great job.

  • @westonjp612
    @westonjp612 11 หลายเดือนก่อน

    Just simply AWESOME! I love it!

  • @SteveBonin
    @SteveBonin 2 ปีที่แล้ว

    Hi Kevin, really nice! I learned a couple of things along the way. I am spending some time with your videos, especially Fridays, it gives me something to do that feels like work but is more fun. Thanks

  • @emmanuelU17
    @emmanuelU17 2 ปีที่แล้ว

    1st time I am watching you use JS! Hahahahaha

  • @josbouma7924
    @josbouma7924 2 ปีที่แล้ว +2

    Nice tutorial, but i've spotted some issues. TranslateX to the right can cause issues when printing the page.
    About the javascript, you might want to avoid using global variables with something like a self-executing anonymous function.

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

    This was so amazing, thank you so much!

  • @jen-vj4vq
    @jen-vj4vq 2 ปีที่แล้ว

    Thank you for this video. I learned so many new things just watching it

  • @roshanaryal310
    @roshanaryal310 2 ปีที่แล้ว

    Great as always Kevin! I love your videos

  • @Oj-Gaming-vt6vd
    @Oj-Gaming-vt6vd 9 หลายเดือนก่อน

    Hey kevin :D Amazing vids mate, they are really helping me progress on my own website :D
    Keep up the good work :)

  • @Daniel-pg8ln
    @Daniel-pg8ln 2 ปีที่แล้ว

    Dude, this was awesome!! Hello from Brasil 😁

  • @pranavyeole102
    @pranavyeole102 2 ปีที่แล้ว

    This channel is really really useful

  • @xomgitsjay
    @xomgitsjay 2 ปีที่แล้ว

    Yay an updated navbar video!

  • @christopherboe
    @christopherboe 2 ปีที่แล้ว

    @supports is rad! I have never used that before thank you!