Aligning Divs Side by Side CSS & HTML tutorial

Поделиться
HTML-код
  • Опубликовано: 1 дек 2020
  • in this video, I will show you how to place three DIVS beside each other using HTML AND CSS. It is easy to accomplish that, and you need to pay attention to the percentages of the width. All divs by default are 100%. if you divide it by three, the results will be 33.33% Set the width of each div to 33.33%. Float the left Div to left. float: left; float the right DIV to right float:right; and to center the middle div, just add margin: 0 auto; This way the divs should be placed next to each other smoothly. Also, if you want to add more width to a specific DIV, basically, decrease the percentage from one Div and add it to the other DIV.
    #webDesign #CSS #html
  • ХоббиХобби

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

  • @michaelbach3681
    @michaelbach3681 10 месяцев назад +11

    this is exactly what i was searching for thank you.

  • @chonu55
    @chonu55 2 года назад +21

    i usually dont leave a comment on videos but you dont know how happy this made me feel, watching my website for a school project fall into place as i learn tables can go into divs, i have been making it all in tables and this video was what i was looking for. its been like 3 weeks of being stuck slow process but now i can finish it.
    again, thank you greatly "the wheelchair guy"

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

      Thank you for watching. Please subscribe to learn more about html and css ✌️

  • @TheWheelchairGuy
    @TheWheelchairGuy  3 года назад +13

    make sure that you include this property in the middle div if the divs are not aligning properly:
    display:inline-block;

    • @sahilverma5181
      @sahilverma5181 3 года назад

      Or give display:flex to wrapper div and give flex:1

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

    You made it so easy for someone who hasn't used CSS/HTML in over a decade. You earned my sub.

  • @robstencool3
    @robstencool3 2 года назад +3

    Thank you so much, you helped me figure out my first css task at my first job 😀

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

    Thank you very much for the intel. I've been struggling since yesterday with the div tags, until I found this video.

  • @DjordjeMajkic
    @DjordjeMajkic 3 года назад +2

    Perfectly explained. Thank you.

  • @xerxesdiaries545
    @xerxesdiaries545 3 года назад +8

    Thank you so very much for this, sir! This is what I'm looking for. God bless you

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

    thank you so much, if this didnt work i was about to do like a million non-breaking spaces until it was on the right side

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

    this is gold i spent lots of time looking for such a simple explanation the calculator bit didn't cross my mind lol
    rank = big PP

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

    Not just that you made it really easy to understand, but you made me proud too coming from the same country, Thank you for this video!

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

    Thank you Sir.... I was able to enhance my current knowledge through this video.

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

    Thank you so much! This video helped out a lot getting my website together!

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

    Ty soo much bro after finding it soo long i finally got the thing i want and you showed everything and concept was also clear 🎉

  • @idntcare159357
    @idntcare159357 3 года назад +5

    Your delivery is very clear, thank you

  • @Master-qk6sj
    @Master-qk6sj Год назад

    Thanks a lot, I've been struggling with this forever but you explained it in 6mins :)

  • @ethan-fw4ue
    @ethan-fw4ue Год назад

    i really appreciate this tutorial! Thank you!!!!

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

    You are a legend!
    Thank you so much!

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

    thanks alot i was spending hours understanding some issue but this video give me idea to fix it mine is totaly different issue but your video just showed me a way to fix my problem

  • @seiyalover1
    @seiyalover1 10 дней назад

    this is so clear and concise thank you so much

    • @TheWheelchairGuy
      @TheWheelchairGuy  10 дней назад

      Glad it was helpful! I hope that you like and subscribe

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

    Thq you so much sir. I was in great confusion of how to do this. But you made me understand.

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

    Thank you very much. Highly appreciate this video.

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

    this video is awesome. helped me to save a ton of time. thank you.

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

    This helped me and the keyboard sound so satisfying

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

    Thank you very very much , this is what I'm looking for

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

    This is exactly what I needed. Thanks!

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

    Thanks a lot..my head was hang..your video make me happy

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

    Mate that helped so much! Thank you!

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

    Your video was really very helpful, to the point and no time wasting. Thank you so much ❤

  • @RahulGupta-fz6kx
    @RahulGupta-fz6kx 2 года назад

    To the point video. Awesome!

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

    Thank you sir for the tutorial.

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

    THANKS I AM HAVING THIS PROBLEM FROM MORE THAN 5 DAYS THANKS FOR SOLVING MY PROBLEM!

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

    Thanks man, helped a lot

  • @kavilivishnu2258
    @kavilivishnu2258 3 года назад

    Thank you very much, Sir! Helped a lot!

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

    Very helpful. Thanks!

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

    Thank u soo much.I've been struggling since yesterday.
    Omg what a relief😊😊

  • @jyotikharoud6704
    @jyotikharoud6704 3 года назад

    Thank you. Keep posting.!!

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

    Well done man , keep up the good work .

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

    Thanks man save my day☺🤗

  • @channelofredes2022
    @channelofredes2022 8 месяцев назад +1

    bro you helped me so much! I was trying to copy the google translate site to improve my skills, but i couldn't do the header, cuz the hamburger menu didn't behave...

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

    Very good my bro . thanks .

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

    Love and support from india..thank you for this

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

    Thank you very much! Helped a lot

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

    Thank you so much sir it really helped me I really need this

  • @jackychan8539
    @jackychan8539 3 года назад

    Best video I've found thank you!

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

    Thankyou so much!

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

    Thank you very much 100x I'm new to code I just finished learning Html but I still have a lot to learn

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

    You are Rock bro now i can move my div thanks a lot good bless you thanks for tis video

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

    I LOVE IT THANK YOU SO MUCH

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

    thanks a lot💙

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

    This video saved me.. Thank you sir

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

    thank you so much sir!

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

    thanks, god bless you

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

    Good understand

  • @jaiharekrishna2132
    @jaiharekrishna2132 15 дней назад

    Thank you you solved my great problem

    • @TheWheelchairGuy
      @TheWheelchairGuy  15 дней назад

      I’m glad to hear that. I hope you like and subscribe

  • @user-lg3ez6if9d
    @user-lg3ez6if9d 2 года назад

    I like this guy....

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

    Thank you sir. Your video helped me. God bless you.

  • @engmohsin1
    @engmohsin1 26 дней назад

    God Bless you Sir Thanks

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

    thank you so much!! i subscribed your channel sir!

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

    actually you helped me a lot :)!

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

    thank youuu so muchhh, this is the one i'm looking for to complete my assignment,thank you so much❤️❤️😭

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

      You’re welcome. Please if you need any tutorials, you can let me know. Once again, thanks for watching

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

      @@TheWheelchairGuy what to do if i'm doing the css in the different file? how to call it?

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

      @@suhailahzawawi you have to include place it in the head tag. Once it is linked, you can test it by changing the background color

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

      @@TheWheelchairGuy thank youuu sir, thank you so much i really appreciate that❤️😭

  • @cecily_6537
    @cecily_6537 3 года назад

    Thank you!!

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

    Thank you soo much🥰🥰
    After many videos....finally you cleared my doubt🙏

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

    Really nice video!

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

    my guy MASHING that keyboard

  • @ASLGaming
    @ASLGaming 3 года назад

    this helped me soo much thank you

    • @TheWheelchairGuy
      @TheWheelchairGuy  3 года назад

      Glad to hear that. Watch my latest tutorial, you might like it. ruclips.net/video/cSon4PW-tiE/видео.html

    • @TheWheelchairGuy
      @TheWheelchairGuy  3 года назад

      Wow!

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

    Thank you !!!

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

    great thanks : )

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

    Great presentation. You could achieve the same thing without calculations by using this on the .container class:
    justify-content: space-between;
    display: flex;

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

      That’s if you’re using flex. You’re right 😍

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

    Bro thank you sooooooooooooooooooooo much you help me a lot

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

    this partially fixed my problem

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

      Hello, what are you trying to accomplish? Let me know, and I’ll help

  • @Rocky-tn4pk
    @Rocky-tn4pk 9 месяцев назад

    thanks for this sir.

  • @blissfulbuzzTV
    @blissfulbuzzTV 3 года назад

    Thank you for your video

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

    Thank you sir!

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

      Thank you for watching. Please check out my latest tutorial ruclips.net/video/bMYFhl0KCnU/видео.html

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

    Thank you :)

  • @ALEXJ99
    @ALEXJ99 3 года назад

    Thank you!

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

    I liked it but I have a question, that how the middle div got on top between other two divs with float left? I mean I tried a lot with margin to get the div2 in the middle but it didn’t had any movement. Thanks

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

      Your middle div did not go to the middle because you have to set the width of the div and you have to set a display to it. For instance, display:block; then, you set margin left and right to auto.

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

    useful video

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

    Thanku so much

  • @abaadali7180
    @abaadali7180 3 года назад

    good

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

    thank you

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

    Thank you sir

  • @TheWheelchairGuy
    @TheWheelchairGuy  Год назад +3

    Watch my latest video about aligning DIVS Side By Side ruclips.net/video/Jstq1otuHAI/видео.html

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

    I've created a system where there are fields where u can input data and it will send the data to the data base once submit button is pressed. Then i saw your vid im planning to add more fields but im having trouble on how can i make all that three div in one submit button. Do u have a tutorial about something like that?

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

      Could you please explain it more a little bit, so I can tell you what to do? Thanks

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

    Thank you, i am practicing making a blog-type of web page, could you please tell me how to make div middle (which i put at 200px height, its a headline) go across the whole page horizontally overriding other divs?? thanks again

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

      You can use z-index to make a div go over the other divs

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

    Good

  • @BobaT__
    @BobaT__ 3 года назад

    so lets say I want to make ONE div and space out the text inside that one div like you did with %'s. How could I go about it?

    • @TheWheelchairGuy
      @TheWheelchairGuy  3 года назад

      Basically use padding: 10%; or something like that

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

    Hi, my 'float-right' does not seem to align, meaning when all of the above is done it sits much like your centre piece one lower than the other 2 divs. Please help

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

      Make sure you set the display of all to to display: inline-block;

  • @At-automotive
    @At-automotive 2 года назад

    Thanks bro😘

  • @johnkabiu4418
    @johnkabiu4418 3 года назад +1

    Thanks.. just need to watch this and done.. problem solved

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

    thanks

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

    Just wonder why the listing of divs was somewhat random, right, left, middle. Why not left, middle, right? Or I am thinking or this in terms of language syntax vs CSS coding?

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

      You could do that and it’s more proper, but I was l just showing you that it doesn’t really matter

  • @nandhini.c4352
    @nandhini.c4352 5 месяцев назад

    Thanks❤

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

    ❤❤

  • @jacobbolmoses8541
    @jacobbolmoses8541 10 дней назад

    Thanks

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

    THANKS

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

    What are you using to write the code, i cant seem to find an editor or something like that

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

      Vs code

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

      @@TheWheelchairGuy thanks very much!

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

      @@TheWheelchairGuy btw, is it an app i can get on mac?

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

      @@proalgcuber198 yes. Here is the link code.visualstudio.com/download

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

      @@TheWheelchairGuy thanks man, im watching a tutorial right now to see how to use it, thanks very much, im also going to watch a lot of your videos to get better at what i am doing

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

    if i want to scroll the middle div while my left and right div remains fixed like facebook then what i have to do???. need youir help

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

      You can simply add position: fixed; to the elements you want to stay on the screen.

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

    Tnx bor

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

    so i have aligned a text at left side and a button at the right side, but they arent in same line. I want them in same line how do i do it i dont get it

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

      set the display to inline block for both elements
      display: inline-block;

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

      @@TheWheelchairGuy thanks it worked