How to create a CSS navigation bar in 6 minutes! 🧭

Sdílet
Vložit
  • čas přidán 20. 09. 2023
  • #CSS #tutorial #course
    This is not a responsive navigation bar. It's meant to be an exercise for beginners to build a very basic navbar.
    HTML CSS nav navigation tutorial example explained

Komentáře • 87

  • @BroCodez
    @BroCodez  Před 11 měsíci +84

    Bro Code

    Bro Code


    Home
    About
    Products
    Contact



    This is the Home page
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam minus eveniet recusandae dicta similique numquam voluptas quos tempore cupiditate pariatur, laudantium fugit alias quia veritatis nesciunt quaerat molestias adipisci assumenda.

    /* style.css */
    body{
    margin: 0px;
    }
    main{
    margin-left: 20px;
    margin-right: 20px;
    }
    h1{
    text-align: center;
    }
    .navbar ul{
    list-style-type: none;
    background-color: hsl(0, 0%, 25%);
    padding: 0px;
    margin: 0px;
    overflow: hidden;
    }
    .navbar a{
    color: white;
    text-decoration: none;
    padding: 15px;
    display: block;
    text-align: center;
    }
    .navbar a:hover{
    background-color: hsl(0, 0%, 10%);
    }
    .navbar li{
    float: left;
    }

  • @zoroskrx
    @zoroskrx Před 7 měsíci +130

    bro cooked and I ate

  • @StopWhining491
    @StopWhining491 Před 7 měsíci +30

    You've got the best step-by-step videos. Thanks for all your work and sharing.

  • @Legomaniac359
    @Legomaniac359 Před 3 měsíci +6

    Straight to the point. Thank you!

  • @amandapanda3750
    @amandapanda3750 Před 3 měsíci +3

    Thanks so much. I've been searching for sooo long to find out how to do this.

  • @mr.shredder5430
    @mr.shredder5430 Před 4 měsíci +3

    just the thing i needed thanks for sharing this content👍

  • @JanviMali155
    @JanviMali155 Před 3 dny

    Amazing work

  • @dmojela1625
    @dmojela1625 Před 3 měsíci

    Best teacher.... 👌

  • @maricarlacerna5841
    @maricarlacerna5841 Před 5 měsíci +3

    Finally! A working code! thank you very much for this @Bro Code you save me from failling

  • @hyzlskyy
    @hyzlskyy Před 16 dny

    the tutorial is simple and straightforward. thank youuuuuu❤❤❤

  • @suyashman7964
    @suyashman7964 Před 7 měsíci +2

    Epic bro

  • @richardolajiga3176
    @richardolajiga3176 Před 6 měsíci +12

    This guy is too good with his explanations

    • @l-fitness3590
      @l-fitness3590 Před 4 měsíci

      It’s straight to the point and easy to understand definitely one of the best

  • @amitcoc7840
    @amitcoc7840 Před 2 měsíci

    Best teacher 🧑‍🏫

  • @nicodiangelotheghostking2
    @nicodiangelotheghostking2 Před 6 měsíci

    THANKS I NEEDED THIS SO MUCH FOR SCHOOL PROJECT🎉🎉🎉🎉🎉

  • @ayannasir6653
    @ayannasir6653 Před 7 měsíci +12

    Make a video on how to put "LOGO" and adjust its height and width using "CSS" with according to our needs?

  • @Asulescu
    @Asulescu Před 2 měsíci

    May god bless you ! Thank you save my life seriously

  • @jakry_apexlegends
    @jakry_apexlegends Před 4 měsíci +4

    You are a gentleman and a scholar. Thanks

  • @MdHossainAhmed-sc4ui
    @MdHossainAhmed-sc4ui Před 3 měsíci

    Very helpful video

  • @abdullahbiswas1
    @abdullahbiswas1 Před 5 měsíci +2

    Thank you for the content

  • @hertechera
    @hertechera Před 2 měsíci

    Appreciate this, thank you

  • @iangabriel1031
    @iangabriel1031 Před 5 měsíci +1

    This is what i need!! Thank you so much bro i will subscribe you

  • @Vivek_top_09
    @Vivek_top_09 Před 5 dny

    Nice bro

  • @bamanbamni
    @bamanbamni Před 4 měsíci +2

    it is important to use main (can we use a div instead of main for main content
    )

  • @Roblox_oyuncu97info
    @Roblox_oyuncu97info Před 6 měsíci

    you are legend - thanks

  • @mohaimenpotawan2842
    @mohaimenpotawan2842 Před měsícem

    very kind blogger

  • @NnFace-ql3jo
    @NnFace-ql3jo Před 4 měsíci +1

    best coder

  • @ayushlimbu8044
    @ayushlimbu8044 Před 3 měsíci +1

    Thanks bro!

  • @princeshukraan3099
    @princeshukraan3099 Před měsícem

    Very good,I love him

  • @chamnabkem5459
    @chamnabkem5459 Před 4 měsíci

    Thank you!!!

  • @ludwajzsk2758
    @ludwajzsk2758 Před 7 měsíci

    👍

  • @ayeshasiddika1252
    @ayeshasiddika1252 Před 2 měsíci

    great

  • @NaftaliKipkoech
    @NaftaliKipkoech Před 5 měsíci

    Bro had to earn my subscription and he did it

  • @ethioictmedia
    @ethioictmedia Před 3 měsíci

    it is Good

  • @shanepelletier2347
    @shanepelletier2347 Před měsícem +1

    for anyone trying to make this responsive:
    body{
    margin: 0px;
    }
    main{
    margin-left: 20px;
    margin-right: 20px;
    }
    h1{
    text-align: center;
    }
    .navbar{
    background-color: hsl(0, 0%, 25%);
    }
    .navbar ul{
    list-style: none;
    padding: 0px;
    margin: 0px;
    display: inline-flex;
    }
    .navbar a{
    color: white;
    text-decoration: none;
    padding: 15px;
    display: block;
    text-align: center;
    }
    .navbar a:hover{
    background-color: hsl(0, 0%, 10%);
    }
    this uses flexbox and added .navbar{} so the background color stretches across the webpage

    • @flinch9710
      @flinch9710 Před měsícem

      You're a lifesaver. Thanks!

  • @user-cu9pd2kv2q
    @user-cu9pd2kv2q Před 3 měsíci

    Thx bro

  • @adejaya1692
    @adejaya1692 Před měsícem

  • @waltermitty4132
    @waltermitty4132 Před měsícem +3

    I don't understand why you added "overflow:hidden" to the CSS file? What is its purpose in this navbar?

  • @user-lg8ms8pw6z
    @user-lg8ms8pw6z Před 2 měsíci

    Hi Bro Codez, Your tutorials is awesome. Please clarify my doubt, Some of the using Flexbox and Grid to align the navbar button but you didn't use that so please explain
    which is correct.

    • @felcynchannel840
      @felcynchannel840 Před měsícem

      I believe you want to use flex box to make it more responsive

  • @prithurajvidyadas2850
    @prithurajvidyadas2850 Před 9 měsíci +9

    why did u use "overflow:hidden" can u explain that part
    like what did u hide exactly?

    • @omairtech6711
      @omairtech6711 Před 8 měsíci +2

      I want an answer to this as well. He did not explain at all.

    • @zoroskrx
      @zoroskrx Před 7 měsíci +8

      it prevents horizontal scrolling

    • @memefromtheinternet
      @memefromtheinternet Před 7 měsíci +2

      @@zoroskrx thanks I also needed that

    • @pholcastaneda3699
      @pholcastaneda3699 Před 5 měsíci +3

      @@zoroskrx But why does setting the property float:left make it disappear? I don't get it

    • @cuteminired6550
      @cuteminired6550 Před 2 měsíci

      Yes exactly ​@@pholcastaneda3699

  • @yashaswimohod9647
    @yashaswimohod9647 Před 2 měsíci

    Can you make a proper responsive website. It will be easy to add in my projects.😉

  • @SpongeknobSquarenut
    @SpongeknobSquarenut Před 3 měsíci

    instead of using colors for navigation bar can i use images?

  • @nazmoonnahar9996
    @nazmoonnahar9996 Před 8 dny +1

    Bro really cooked

  • @kyonsmith9859
    @kyonsmith9859 Před 6 měsíci

    ty

  • @chilli_Tea
    @chilli_Tea Před 5 dny

    extra challenge: style nav with flexbox

  • @brightasinde7034
    @brightasinde7034 Před 4 měsíci

    Sir Please am looking for how to creat contact form email, text using nave element instead of div element ?

  • @asa-od9pu
    @asa-od9pu Před měsícem

    How do I center the navigation br in the center of my webpage, it wants to all shift to the side but I want it to be about 100 pixels long and center with h1

  • @gian-mm9kr
    @gian-mm9kr Před 5 měsíci +2

    How can I center the nav bar ? the only way i was able to get was creating a div section.

    • @bqadrat
      @bqadrat Před 2 měsíci

      Try this:
      .navbar li{
      float: left;
      width: 25%;
      }
      Of course 25% is for 4 elements as it equals 1/4 :)
      You can also enter:
      .navbar ul {
      display: flex;
      justify-content: center;
      }
      and then try lower the width percent to see the result and fit it to your expectations.

  • @johnryder8464
    @johnryder8464 Před měsícem +1

    Using floats is not the way to do it. Flexbox takes care of that.

  • @GiorgiTarielashvili
    @GiorgiTarielashvili Před měsícem

    Sigma

  • @nathansimelane562
    @nathansimelane562 Před 2 měsíci

    What have I done wrong because my display:block and text align center is not working

  • @EnderKyo
    @EnderKyo Před 5 měsíci

    My styled nav bar isn’t showing up on my second page the links are there it just isn’t styled like the home page, any thoughts?

    • @bqadrat
      @bqadrat Před 2 měsíci

      lack of on your second page? Did you solve it?

    • @EnderKyo
      @EnderKyo Před 2 měsíci +1

      @@bqadrat thanks a bunch man I appreciate your comment but I already passed the class so I’m set 😂

  • @haloholahehe4285
    @haloholahehe4285 Před 4 měsíci

    Damn I envy those who can speak English :(
    Please add Indonesian subtitles 🙏, especially lessons about the 24-hour,12-hour,or 8-hour Java course, Java script, PHP, and others.😅

    • @haloholahehe4285
      @haloholahehe4285 Před 4 měsíci

      Your video is really great and I want to learn it but I have problems with the English it uses, especially the programming language lessons I want to learn.😅

    • @Pororo1726
      @Pororo1726 Před 2 měsíci

      Aowkaowkoakw pake translate ke bahasa Indonesia aja bang

  • @kiddReyes
    @kiddReyes Před 2 měsíci

    If I want to float right why does my words reverse

  • @SD88237
    @SD88237 Před 6 měsíci

    1:50

  • @patriayvida4209
    @patriayvida4209 Před 6 měsíci

    Is it Responsive bro?

    • @Peywan
      @Peywan Před 6 měsíci +1

      Nope

    • @jivara5523
      @jivara5523 Před 5 měsíci

      You can do it with the flex-box

  • @athenadaniellacruz8968

    Why mine isn't working😭😭

  • @EnderKyo
    @EnderKyo Před 5 měsíci +1

    Does anyone know how to keep it vertical and to the left?

  • @AlThePal78
    @AlThePal78 Před 4 měsíci

    you could of just put margin: 0 20px;