This Advanced Flexbox Trick Is Amazing!

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2022
  • Full Video: • 6 Advanced Flexbox Fea...
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    #Shorts

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

  • @WebDevSimplified
    @WebDevSimplified  ปีที่แล้ว +66

    Full Video: th-cam.com/video/1zKX71GYisE/w-d-xo.html

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

      jj

    • @tegotypunikos
      @tegotypunikos 7 หลายเดือนก่อน +23

      I hate that non-clickable links. It's just official youtube site

    • @Pictor13
      @Pictor13 5 หลายเดือนก่อน +1

      ​@@tegotypunikos it's to train your memorization skills, after degeneration from too much binge watching 😁

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

      @@tegotypunikos highlight, right click, and go to.

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

      I wish I saw this short so long ago. Watching the full video now, thanks!

  • @cherubin7th
    @cherubin7th ปีที่แล้ว +357

    Flex box finally something in css that works as expected.

    • @adnanal-beda9734
      @adnanal-beda9734 6 หลายเดือนก่อน +34

      Wait until it wraps

    • @vothaison
      @vothaison 6 หลายเดือนก่อน +3

      The most amazing thing about flex box is that IE supports it.

    • @proudyy
      @proudyy 5 หลายเดือนก่อน +7

      ​@@vothaisono
      But
      IE is dead so who cares lol

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

      it always worked as expected. this "trick" always worked

    • @playvideogames369
      @playvideogames369 22 วันที่ผ่านมา

      ​@@adnanal-beda9734 align-content

  • @thedigitalceo
    @thedigitalceo ปีที่แล้ว +155

    This is one of the greatest benefits to flex box for some reason I’ve never used. Love it 🎉

  • @thatsalot3577
    @thatsalot3577 ปีที่แล้ว +66

    Holy frick I never thought of that, thanks Kyle, I always used to wrap middle contents with another flexbox and then do justify-content space between.

  • @aleksd286
    @aleksd286 ปีที่แล้ว +14

    Feels like a hack to use margins for this

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

      +1. Wrapping middle elements in a container div and then justifying space between is better I think.

  • @Anonemmas
    @Anonemmas 2 หลายเดือนก่อน +1

    This has been my go to way of making my footer stick to the bottom of the screen in all my layouts 🚀

  • @PokeBowl82
    @PokeBowl82 ปีที่แล้ว +60

    that was sick !! i always tend to flex-box justify center the middle one

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

      animated Box With CSS
      th-cam.com/video/gBmx3RmThDE/w-d-xo.html

  • @SamuelGfeller
    @SamuelGfeller 2 หลายเดือนก่อน +2

    The real pain comes when having to do responsive design with the wrapping of flexbox elements with dynamic widths

    • @yourlocalhuman3526
      @yourlocalhuman3526 13 วันที่ผ่านมา +1

      Yh it pretty much makes it all a pain in the ass

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

    Bruh… ive been trying to find a shortcut to what you did in the end there for literally years 😂 thank you for finally closing that search

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

    you can do margin bottom and top auto as well when it's a column direction ⬇️ i believe.

  • @disgracefulcoder1818
    @disgracefulcoder1818 ปีที่แล้ว +9

    Thanks homelander for the valuable information 😀

  • @marcoscabrinirianidosreis6655
    @marcoscabrinirianidosreis6655 11 วันที่ผ่านมา

    That’s super useful for building navigation

  • @samben08
    @samben08 ปีที่แล้ว +15

    Thank you! You just saved me from nested divs madness. 😀

  • @hussainbharmal5998
    @hussainbharmal5998 ปีที่แล้ว +7

    This guy is in the wrong profession, he should be in the movies

  • @bape155
    @bape155 25 วันที่ผ่านมา +1

    Align-self...

  • @lady1kaka
    @lady1kaka ปีที่แล้ว +10

    When I first found this Out, was mindblowing 🤯 I use this very often

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

      animated Box With CSS
      th-cam.com/video/gBmx3RmThDE/w-d-xo.html

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

    Flexbox is one of the best things that happened in CSS.

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

    Kyle only uploads BANGERS

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

    thank you. i searched a solution like this over months 💪🏻

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

    Very useful Tip that I didn't know. I have faced problems making navigation bars now I will just use this!.

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

    I’ve been looking for this solution for a long time! I never knew margin-left: auto would have such an effect

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

    Lightbulb, lightbulb, lightbulb!!! I never thought of doing that :first-child or :last-child "hack" to flexbox to position a whole group of things. Wow!!

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

    Thanks. Your content is always reliable and straight to the point. There exist a jackass with a very popular channel who always starts coding in the middle of his content while only showing half the code. His github is also nearly blank. I guess he is trying to sell content. You sir are awesome. You are not the Jackass.

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

    Creating navbar a little less wordy now.

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

    Where were you all these days?
    Awesome tip.
    Thanks a lot dude.

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

    Such a quick and easy fix. Thanks for this.

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

    Flexbox was probably one of the best additions in the history of CSS. Goodbye to float:left and clearfix hacks. It makes layouts so much easier and versatile.

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

    I would rather use "align-self" and "justify-self" instead of margin for placing items in the container

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

    after watching this guy for a while and seeing the dream face reveal, i am 100% convinced this is either dream doing a hobby or it's his long lost twin

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

    flex:1 laughing in corner

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

    this is so useful for header with avatar and navs

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

    Love your videos my brother, straight to the point!

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

    All the contents you posted are amazing....

  • @zagrios6686
    @zagrios6686 ปีที่แล้ว +10

    try to do the same but with multiple lines 😉

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

    I remember life before flexbox. I feel like the old people who talk about how they had to walk to school lol

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

    I had to wrap stuff into redundant divs for this use case.
    I know better now.

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

    You can also use :nth-child()

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

    i was looking for this , helped me thanku

  • @Noam-Bahar
    @Noam-Bahar 9 หลายเดือนก่อน

    Instead of margin-left and -right, I recommend using margin-inline-start margin-inline-end. This way even if the website's direction changes to right to left, the auto margin won't break as it adapts

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

    I've mostly used margin auto on the center element within a flexbox container. Thanks for the tip.

  • @Navistar-cu2po
    @Navistar-cu2po 4 หลายเดือนก่อน

    Thank you!

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

    Wow 😱 amazing! Thank you so much

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

    Just what I have been looking for. Thanks alot bro

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

    I just love this guy.

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

    Wow,perfect teacher

  • @0xPanda1
    @0xPanda1 ปีที่แล้ว

    thanks a lot this helps a lot with headers

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

    that's exactly what i need right now

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

    This is really helpful!

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

    I love your css videos

  • @user-op4zy8jg9j
    @user-op4zy8jg9j 5 หลายเดือนก่อน

    instead of using marging use
    align-content:space-around;

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

    Thanks!

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

    Thanks , that was helpful

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

    This is awesome, I’ll definitely use it

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

    thanks man

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

    Nice! I will be using that in the future.

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

    Yeah flex is pretty sweet, though does feel like I sometimes overuse it.

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

      As long as it gets the job done

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

    thank you, darling, this is helpful, I currently building a responsive website using flexbox and grid template

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

    It's a good idea putting "flex-shrink: 0;" when using auto margins, because you might end up shrinking the rest of the elements on some browsers. ✌

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

      animated Box With CSS
      th-cam.com/video/gBmx3RmThDE/w-d-xo.html

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

    That was amazingg!!

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

    My savior

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

    Goddamn i always used to wrap them in different boxes

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

      Helpline 📲📩⬆️
      Questions can come in⬆️

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

      thats actually much better

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

    I love flex-box, but I can I can never remember anything and basically trial and error my way around till it looks right.

  • @Bot-lj6nu
    @Bot-lj6nu ปีที่แล้ว

    Flex box really flexible

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

    me acabas de salvar de un dolor de cabeza que tengo con unas alineaciones en algo que estoy desarrollando, gracias :D

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

    I learned this from Kevin, but nice trick!

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

    Thanks

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

    This is pretty cool,I always had to use justify between 🤣

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

    I feel proud because I knew it for a long time

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

    I would have made an empty element with flex grow on it but I guess that’s fine

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

    the way I do it is with 2 boxes, the outer one and the middle one and then space between. never thought of doing it this way but again while I'm okay at CSS I'm not excellent at it lol

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

    nice sir i really like your of your toturials
    there are many things that im learning from your toturials 💖💖💖 thanks.

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

    What about breaking it into two container within flex box ? I think that’s what I’ve been doing since forever.

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

      animated Box With CSS
      th-cam.com/video/gBmx3RmThDE/w-d-xo.html

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

    Umm anyone else who's going to make navbars with this😂😂

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

    Let's guess some best uses:
    Headers, nav bars,..

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

    Boss I have advanced flexbox knowledge.
    Boss: that's nice.

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

    I need a video on the longest way to center a div, more code == more better

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

    I will add on flex item : the gap of 2 and have it as margin

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

    I use this a lot of times

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

    this trick is very useful if i mean logo is meant to be at right and searchbar or other stuff at other side 🎉🎉

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

    Awesome thx bro

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

    cool, cool. thanks, Cyle!

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

    Great for building navbars.

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

    Thanks it’s for this realy good trick

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

    The truth which matrix stuck people can't understand.

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

    thts wht i exactly needed

  • @asante5979
    @asante5979 10 วันที่ผ่านมา

    But why does margin's "auto" behave this way?

  • @DZ-lp6ls
    @DZ-lp6ls ปีที่แล้ว

    But what if you do want a margin-right on the element in case the viewport is so small that there is no extra space?

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

    Y it is always ur shorts are easy to understand

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

    flex box the best property in css

  • @s.g.5318
    @s.g.5318 ปีที่แล้ว

    My content: *commits tax fraud *
    Me: your honour, Flex box !

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

    grid is the best

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

    What about align-self

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

    The real problem with websites is all browsers don't act the same way.

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

    I was not even aware of it😂

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

    Damn that’s amazing

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

    Would the two middle ones be second child and third child?

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

    Flex box frogyy

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

    Great work. Audio not clear.

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

    What about align-self?

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

      Align self doesn't work with flexbox

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

      align-self works with *display: grid;*

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

      ​@@iamenochleeim pretty sure it's justify self that isn't supported by flex. Not align self

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

    can you add a tutorial explaining screens , why css behave the way it does with mobile screen in compered to monitors and resolution pixels ...