Thought I knew CSS. Then I discovered this channel. Now I never know how to feel after watching these videos. Happy to have learned something, close to tears when I realize how little I know.
This is still one of the greatest bang for buck methods for arranging elements, especially for older pages/designs that don't have full fledged flex/grid/container implementations. Thanks again Kevin
What are the freaking odds that I come across this video on my feed while running into this exact problem with centering specific flex items while also pushing a few to the right? Kev you're the best!
Every time I hear someone say 'em' when they talk, I now always feel they're trying to make a space in the sentence. That and recognising fonts in everyday life are things I'll probably never forget. Thanks css!!
I kinda knew how auto in CSS workes, but now I'm confident. Thanks again, Sir. If you think you have seen enough of CSS. You gotta binge watch Kevin's whole channel.
When I started with css 100 years ago, I always wondered why you can center horizontally using margin auto, but not vertically. I love this vertical margin auto that has been made useful at last. This trick is so nifty when you want to align top/bottom some common elements within cards (such as link "Read more")
I learnt a while ago how to use margin: auto with flex-box to move one or several items to the opposite side, but I didn't know you could also use it to center one or some of them too. Thank you very much, Kev! :)
To be fair, this all makes perfect sense when you give it some thought, but I would have never thought about this before seeing this video. I swear to god the knowledge this channel provides regarding CSS is pretty much unrivaled as far as I know, it's great.
The guy teaches CSS fundamental concepts with practical use cases that makes me to watch only CSS videos on entire the TH-cam. Even though I hate CSS yet I love to watch his videos. Thanks man!
Kevin, I’m so glad I found your channel! My CSS knowledge was pretty extensive… in 2010. I’ve been out of the game for a while, so I’m learning to unlearn the hacks I’d learned to overcome Internet Exploder and other limitations. CSS seems to finally be mature, though I’m happy with how much of my old learning still applies!
Hey Kevin!! Sorry I'm so late to the party, but just wanted to let you know how much your videos are helping me out. I'm very new to the whole html/css/js thing, so tend to learn something new from any video I watch, but I find your way of explaining things and the level of detail you include seems to increase my understanding so much more. Thank you!
Your channel is so helpful and you make everything so easy to understand. Much appreciated and please keep the content coming!! Sincerely, Front end developer student in his first week :)
Hi Kevin, I have watched many of your videos and they are always well done. I write websites in the raw code (not templates) and have done a good handful of sites. This particular video directly addresses serious headaches I run into with respect actually achieving the spacing I am looking for in my navigations or other list-options areas. I won't bore you with the details of what I have done to make it work (it is WAY too embarrassing). It is the combination of the margin usage you discuss WITH THE "nth-of-type()" selecting you are doing that enables a big reduction in BOTH the amount of CSS and the amount of HTML/Structure required. Thanks again.
In such cases it is more flexible to use a few dummy elements (does not render anything) and to insert them on those places where space should be taken (for example class="takeSpace") with style "flex-grow: 1;". This approach will work as expected when new link is inserted in the middle. Also it is possible to redistribute space in more flexible way by using different flex-grow values.
I didn't learn anything from this video, but WHAT A GREAT VIDEO! I need to say that you are killing it at the content quality. I follow you channel for at least 2 years from now, and i need to give some feedback. The quality of the videos, the editing, the timing, its much more robust, you are really doing an amazing job, congratulations a lot. This tips and simple exemples help a lot, keep doing. Sometimes the subject of the video is not a new topic for me, but i always try to watch, just for the channel support, best regards. (sorry my noobie english)
hello Kevin , I honestly just want to thank you enough ;u are doing such a wonderful job. I have been through your responsive layout course, it has made me better. I hope you never stop!!!! Thank you so very much!
Great work! From a practical application point of view, the only suggestion I would make would be to add margin-left: auto to li:nth-last-child(2) instead of li:nth-of-type(6) because it's much more likely that a client will want to add another item to the middle 'site menu' than to the right hand 'login menu'. The way it's set up now, if you were to add, let say 'Shop' to that middle menu, the layout would break. (You'd also need to change nth-of-type(7) to nth-last-child(1) but that probably goes without saying)
Continue to love your stuff, Kevin! This definitely helped far more eloquently solve a problem I've had to hack together in the past. Keep up the awesome!
This is amazing for accessibility. The amount of time I've spent wrapping content in parent elements to ensure flex or grid is inherited... You can remove so much unnecessary divs and other container tags. Great content, I'll be using this first thing tomorrow for my project, thanks!
Something to keep in mind though, that this example depends on a static page. If you'd add any navigation elements it would mess up all indices. Still very interesting and useful tool.
I don't think I have subscribed to channel after watching just 2 videos, but this content is just really good and very well explained, so I subscribed. I am more of a backend person and gets tripped up with css sometimes so these videos are great for me.
Wow, thanks for reminding me that you could actually center with margin:auto. I pretty much only use flexbox these days for centering. The good old times :D
Thanks Kevin, that's very awesome of you to do this quick Tut. Using Flex-box on a sidebar is a stroke of genius, what else should I have expected. How about drop-down menus inside the menu. Obviously, sub-lists would be one way.
you need to 100 percent release a UDEMY course for begginers from start to finish from basic HTML / CSS and maybe some Javascript. I would 100 percent purchase it.
Thought I knew CSS. Then I discovered this channel. Now I never know how to feel after watching these videos. Happy to have learned something, close to tears when I realize how little I know.
Haha, same here!
The same too 😂
It's like some guy is a better boyfriend to my girlfriend than I am. Kevin is the mac.
How absolutely fabulous 🤩
"My flex grow is making it grow" - 2020 Kevin Powell
weird flex, but ok.
This is still one of the greatest bang for buck methods for arranging elements, especially for older pages/designs that don't have full fledged flex/grid/container implementations. Thanks again Kevin
You should definitely release more courses on how to use CSS in general. You are a really good teacher.
Honestly his approach to teaching is by far the best I have come across here on YT. This is game changer..
when Kevin Powell uploads a CSS video you f***ing click it.
Facts!!
Indeed
204k subscribers can't all be wrong. I hope you boys are making KP _feel the love_ on Patreon . . .
@@djeudy re the point every see esa Re Re ek ek baat
Best Teacher on TH-cam 🙏🏻
So simple, yet profound, a master piece of CSS code. Poetry written in CSS.
What are the freaking odds that I come across this video on my feed while running into this exact problem with centering specific flex items while also pushing a few to the right? Kev you're the best!
Every time I hear someone say 'em' when they talk, I now always feel they're trying to make a space in the sentence. That and recognising fonts in everyday life are things I'll probably never forget. Thanks css!!
I kinda knew how auto in CSS workes, but now I'm confident. Thanks again, Sir.
If you think you have seen enough of CSS.
You gotta binge watch Kevin's whole channel.
I love how happy he gets when saying "That's awesome". It's like watching Simon from Cracking the Cryptic finding his solution.
The value of knowledge in your whole videos is very expensive. And you gave us for free. Thank you very much.
When I started with css 100 years ago, I always wondered why you can center horizontally using margin auto, but not vertically. I love this vertical margin auto that has been made useful at last. This trick is so nifty when you want to align top/bottom some common elements within cards (such as link "Read more")
I appreciate that you add the errata , and also that you did it well (timing, and placement)!
I learnt a while ago how to use margin: auto with flex-box to move one or several items to the opposite side, but I didn't know you could also use it to center one or some of them too.
Thank you very much, Kev! :)
Awesome, you always reveal something over stuff I think I know already. Keep up the great content.
Woah, my jaw literally open wide while watching this, i never knew those flex trick would make vertical margin auto work.
Nice video
To be fair, this all makes perfect sense when you give it some thought, but I would have never thought about this before seeing this video. I swear to god the knowledge this channel provides regarding CSS is pretty much unrivaled as far as I know, it's great.
How to be you sir?
The guy teaches CSS fundamental concepts with practical use cases that makes me to watch only CSS videos on entire the TH-cam. Even though I hate CSS yet I love to watch his videos. Thanks man!
Kevin, I’m so glad I found your channel! My CSS knowledge was pretty extensive… in 2010. I’ve been out of the game for a while, so I’m learning to unlearn the hacks I’d learned to overcome Internet Exploder and other limitations. CSS seems to finally be mature, though I’m happy with how much of my old learning still applies!
Hey Kevin!! Sorry I'm so late to the party, but just wanted to let you know how much your videos are helping me out. I'm very new to the whole html/css/js thing, so tend to learn something new from any video I watch, but I find your way of explaining things and the level of detail you include seems to increase my understanding so much more. Thank you!
This became my favourite channel to learn CSS - Practical, great didactic, and to the point
Your channel is so helpful and you make everything so easy to understand. Much appreciated and please keep the content coming!!
Sincerely, Front end developer student in his first week :)
Magicien of CSS !
Using display flex to give margin auto super powers I love it. Did not know about that unique behavior.
Hi Kevin, I have watched many of your videos and they are always well done. I write websites in the raw code (not templates) and have done a good handful of sites. This particular video directly addresses serious headaches I run into with respect actually achieving the spacing I am looking for in my navigations or other list-options areas. I won't bore you with the details of what I have done to make it work (it is WAY too embarrassing). It is the combination of the margin usage you discuss WITH THE "nth-of-type()" selecting you are doing that enables a big reduction in BOTH the amount of CSS and the amount of HTML/Structure required. Thanks again.
Sir you just rocked. You just cleared our deepest doubt about the flex box. Thank you very much sir 🎉
Yes, I use such margins all the time in the flex boxes in my practice. Thanks, Kevin!
In such cases it is more flexible to use a few dummy elements (does not render anything) and to insert them on those places where space should be taken (for example class="takeSpace") with style "flex-grow: 1;".
This approach will work as expected when new link is inserted in the middle. Also it is possible to redistribute space in more flexible way by using different flex-grow values.
You did it again!! Your channel is the top of top. Thanks Kev!
Didn't know flex-grow also works vertically. I was using height:100vh instead. Thanks for the tip!
I didn't learn anything from this video, but WHAT A GREAT VIDEO!
I need to say that you are killing it at the content quality. I follow you channel for at least 2 years from now, and i need to give some feedback. The quality of the videos, the editing, the timing, its much more robust, you are really doing an amazing job, congratulations a lot.
This tips and simple exemples help a lot, keep doing. Sometimes the subject of the video is not a new topic for me, but i always try to watch, just for the channel support, best regards. (sorry my noobie english)
hello Kevin , I honestly just want to thank you enough ;u are doing such a wonderful job. I have been through your responsive layout course, it has made me better. I hope you never stop!!!! Thank you so very much!
I love this one, thanks for the content Kevin.
Great work! From a practical application point of view, the only suggestion I would make would be to add margin-left: auto to li:nth-last-child(2) instead of li:nth-of-type(6) because it's much more likely that a client will want to add another item to the middle 'site menu' than to the right hand 'login menu'.
The way it's set up now, if you were to add, let say 'Shop' to that middle menu, the layout would break.
(You'd also need to change nth-of-type(7) to nth-last-child(1) but that probably goes without saying)
Best CSS designer you're..... You're always helping me a lot.
Brilliant stuff Kevin. You've got a gift for explaining things simply and succinctly. Keep up the fab work and much appreciated.
Continue to love your stuff, Kevin! This definitely helped far more eloquently solve a problem I've had to hack together in the past.
Keep up the awesome!
You're a great instructor Kevin. Thank you
thank you , great teacher !! love from Tunisia .
I am currently learning the basics of CSS and this video gave me more motivation to go forth. So many crazy stuff that can be done with CSS!
That's powerful, Powell. Perhaps I should say a Powellful CSS margin usage indeed.
Def learnt more than a couple things, thanks as always Kevin, the way you explain the markup is awesome
Brilliant! Thank you. After doing CSS since 20 years I learned something new today :-)
WOW, that's really cool. There are more things to use margin auto in CSS. Thanks a lot for the video.
Never have I ever had a hard time learning something other than CSS.
This is amazing for accessibility. The amount of time I've spent wrapping content in parent elements to ensure flex or grid is inherited...
You can remove so much unnecessary divs and other container tags.
Great content, I'll be using this first thing tomorrow for my project, thanks!
Same thing I said to myself. Lighter DOM, faster render tree
This is brilliant! I'm fantasizing about all the fun I can have with this and media queries. Thank you for sharing.
Something to keep in mind though, that this example depends on a static page.
If you'd add any navigation elements it would mess up all indices.
Still very interesting and useful tool.
hi, what do you mean by navigation elements?
Thank you man, good tricks for beginners to simplify markup just using margin property
I'm really thankful for this. What I needed
Thanks Kevin for sharing your knowledge.
It is very painful to learn on your own such effects but you make these things very simple and easy. Thanks
It's been long since I've learned something new so cool in CSS. It's amusing to always know that there's something new to learn.
Your the only one who actually understands and can explain CSS. I just keep typing trash until it looks like I want it to.
You are really " The King of CSS "
Ah, super useful, particularly for the vertical positioning!
Kev you easily deserve 1 million + subscribers. Thanks again for this great video!
you're awesome! i always stuck with floats , now its very easy.
Super useful !Thank you Kevin !
I don't think I have subscribed to channel after watching just 2 videos, but this content is just really good and very well explained, so I subscribed. I am more of a backend person and gets tripped up with css sometimes so these videos are great for me.
Thanks Kevin! Extremely helpful as always
I used to do divs and was overwhelming. Thanks powell
I see why sometimes my margin didn't work properly, display:flex is the cause! Thanks
You can probably rename this video to "Do you even Flex bro?"
Simply awesome tips
Kind of first day at work and I did shine like a hero.
A day, or two ago I watched THIS very video.
Flex -> margin-top:auto did magic in Woo's tile.
Awesome content as always. Got better clarity.
I have always used backgrounds when doing layout. It just makes it a lot easier to see what is happening. ✌️
Incredible. Thanks Kevin.
I have recently found your tutorial. You are doing a great job! Keep up the good work, Kevin!
You have really helped me. Thank you!
Wow, thanks for reminding me that you could actually center with margin:auto. I pretty much only use flexbox these days for centering. The good old times :D
Thank you for these videos, they're really great
Merveilleux! Just the solution I for a problem I had! Thanks
Thanks Kevin, that's very awesome of you to do this quick Tut. Using Flex-box on a sidebar is a stroke of genius, what else should I have expected. How about drop-down menus inside the menu. Obviously, sub-lists would be one way.
Thank you Kevin
Great stuff as positioning options are always very welcome.
thank you Kevin for making my corner of the internet a little bit more awesome ;)
Cool options with margin, Thanks Kevin❤
bro, you're awesome
Pretty awesome! Thank you.
Appreciated for sharing Kevin👍🙏 it is really useful.
Hi Kevin, really loved this video. I always get stuck wih CSS and this helped me alot to understand how this all works. 👍
You are a great teacher, Kevin!
You deserve much more subscribers and thumbs up, Keep it up!
your videos are well structured and good , keep up the great work you are great teacher.
Kevin, your tutorials are awesome..!
When I rewatch this video, I might finally know how to center a div.
Been learning so much from you, you're amazing!
Great vid. Very handy feature. Thanks, KP.
Your tutorials are really awesome
You are amazing. Thank you for making great contents.
Super super cool content Kevin, thanks a lot ❤💻
you need to 100 percent release a UDEMY course for begginers from start to finish from basic HTML / CSS and maybe some Javascript. I would 100 percent purchase it.
Thanks for the video. As always Kevin's teachings are THE best..!!
CSS gems accumulated today. Thanks Kevin.
Another day, another thing to learn about CSS from the master!
Awesome video! Very useful!!! Thanks for posting!
Thanks, Kevin
Awesome stuff. Thanks a lot! ❤
Very helpful, thanks so much!