The secret to mastering CSS layouts

  Рет қаралды 268,082

Kevin Powell

Kevin Powell

Күн бұрын

Deep dive this topic, and much more, in my course CSS Demystified: cssdemystified.com/?...
🔗 Links
✅ Why flex items with padding aren’t the same size (it’s an article, not video, sorry!): • Flexbox is more compli...
✅ Flexbox or grid - How to decide? • Flexbox or grid - How ...
✅ More on collapsing margins: • Margin and Padding Dee...
⌚ Timestamps
00:00 - Introduction
00:53 - Relationship between parents and children width and height
04:32 - Child’s margin impacting the parent
08:27 - Flex and grid’s influence on the relationships between siblings
#css
--
Come hang out with other dev's in my Discord Community
💬 kevinpowell.co/discord
Keep up to date with everything I'm up to
✉ www.kevinpowell.co/newsletter
Come hang out with me live every Monday on Twitch!
📺 / kevinpowellcss
---
Help support my channel
👨‍🎓 Get a course: www.kevinpowell.co/courses
👕 Buy a shirt: teespring.com/stores/making-t...
💖 Support me on Patreon: / kevinpowell
---
My editor: VS Code - code.visualstudio.com/
---
I'm on some other places on the internet too!
If you'd like a behind the scenes and previews of what's coming up on my KZfaq channel, make sure to follow me on Instagram and Twitter.
Twitter: / kevinjpowell
Codepen: codepen.io/kevinpowell/
Github: github.com/kevin-powell
---
And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

Пікірлер: 229
@whatthefunction9140
@whatthefunction9140 Жыл бұрын
"The children are being forced to live inside those cells"... you said it
@sugaslate14
@sugaslate14 11 ай бұрын
😂😂😂😂😂
@SDRMusic777
@SDRMusic777 9 ай бұрын
🤣🤣🤣🤣
@lolidkstudio
@lolidkstudio 8 ай бұрын
lmao
@ismailcreatvt
@ismailcreatvt 8 ай бұрын
😅😂😂
@shanmukhasaratponugupati6308
@shanmukhasaratponugupati6308 6 ай бұрын
😂😂😂
@akshaymondal1372
@akshaymondal1372 Жыл бұрын
You don't have any idea how much you have helped me with your videos.. I literally was on the notch of giving up css.. but now .. this is the one of those things about which I feel confident . Thanks a lot sir . Kudos to you.
@KevinPowell
@KevinPowell Жыл бұрын
That's amazing! Thanks so much for letting me know, that makes my day 😊
@xClown55
@xClown55 Жыл бұрын
Same here, css back in my college years would be as frustrating as js now it feels kinda easy
@Waqar_Ahmed75
@Waqar_Ahmed75 Жыл бұрын
Same here...
@zettai8087
@zettai8087 9 ай бұрын
Wow. I hope I'll be able to share a testimony like this
@zettai8087
@zettai8087 9 ай бұрын
Cus I feel I just don't know how to use css to make a website look jot it ought to look and I'm frustrated
@RealCaptainAwesome
@RealCaptainAwesome Жыл бұрын
Whenever I question my choices that lead to me becoming a back end engineer, I watch one of your wizardry videos and feel much better.
@KevinPowell
@KevinPowell Жыл бұрын
🤣🤣🤣
@zorokutend
@zorokutend Жыл бұрын
I choose to be on the both sides. Trust me, when you know how it works. You feel like you are god :D You can control everything in the eco system. And that feels really GOOD . Oh yeh
@gg-gn3re
@gg-gn3re Жыл бұрын
Yea I've worked with dozens of front end guys and he knows way more than they knew. I know about the same as they did and can figure my stuff out. The lack of front end knowledge is very obvious on many sites, facebook for example uses the old 960px layout from the 1990s and is very static looking and old fashioned. It works I guess, but it is obvious they have no clue what to do there or how to fix it.
@luizinniziul2976
@luizinniziul2976 Жыл бұрын
same feeling
@elvissautet
@elvissautet Жыл бұрын
😅😅😅😅😅
@francopdx
@francopdx Жыл бұрын
Thank you for all the tips! The differences between flex and grid in regard to parent vs child influence was very enlightening! I've been using flex for almost a couple years, but it was just a few months ago that I really started dabbling with grid.
@the-real-tridder
@the-real-tridder Жыл бұрын
great information mate, really apprecite the time you take to explain these really important concepts. The importance of relationships is so underrated when most people discuss css.
@tdematos
@tdematos Жыл бұрын
The way you understand how everything comes together is unbelievably easy to understand! Definitely earned a new subscriber! 🙏
@IamPetrus
@IamPetrus Жыл бұрын
Hey Kevin, I was having issues with a very basic relationship between a parent-child situation kept with flexbox. Your video came up here and then I understood what was going on after a terrible feeling of frustration. And man, you named them all! Gracias Kevin!!!
@bumbleguppy
@bumbleguppy Жыл бұрын
Just like the best cooking videos, showing the underlying "why" instead of simply specifying "how" imparts an understanding that can be applied to any recipe and not just the one you're working on. Thank you for your style of video.
@pkunzel
@pkunzel Жыл бұрын
"They don't live in isolation, they live in relation" That is the biggest challenge I have when teaching CSS. Amazing video!
@yourlinuxguy
@yourlinuxguy Жыл бұрын
Try Grid?
@WadieGamer
@WadieGamer Жыл бұрын
I've been following your videos for almost a year and I want to thank you so much for making my CSS learning much better.
@lauramangu2516
@lauramangu2516 Жыл бұрын
Amazing content as always! You are my primary source of learning when it comes to Css, Kevin! Kudos to you and thank you for these great videos. Please never stop :)
@andrewferguson7859
@andrewferguson7859 Жыл бұрын
Thank you for the clear, and quick review this topic. I always learn something, and that was certainly the case here. Just yesterday I was working with flex and grid and got myself thoroughly confused. Thanks to this refresher, I better understand what was confounding me so much yesterday.
@Spreadlove5683
@Spreadlove5683 Жыл бұрын
Dope!!!!! This is the exact question I've been wondering about for so long -- just how everything fits together and how relationships play out. Bought your CSS Demystified course just now. Excited to get a firm understanding of the fundamentals.
@goannacs6861
@goannacs6861 Жыл бұрын
I learn HTML and CSS. I even attend some kind of online school and Udemy. But you are the only one who really helps me understand every bit. You have such a calming and logical way to explain things. You just feel secure about it afterwards. It's strange. It's like you were born for this stuff haha 😆
@BinaryStar10
@BinaryStar10 Жыл бұрын
Notes to myself: -Parent dictates children's width. Children dictate height... unless you set height and possibly cause overflow issues. -A simple wrapper with max-width and margin-inline: auto. -Collapsing margins - child's margins can reach outside parent (margins merge to parent). This can be prevented by removing margins from child, adding padding to parent or changing to a formatting context where collapsing margins don't exist (such as flow-root, flex and grid). -Using flex you can have even sized columns with flex: 1. But if columns have varying sized paddings, they are not even sized. Grid on the other hand takes padding into account when calculating size and therefore columns are even sized if they are set to be even.
@MasteringGravity
@MasteringGravity Жыл бұрын
Thanks for the notes! Mind if I also use these? 😁
@carldrogo9492
@carldrogo9492 Жыл бұрын
Use Grid NOT Flexbox. 😉
@BinaryStar10
@BinaryStar10 Жыл бұрын
@@MasteringGravity Feel free! :)
@ilovelctr
@ilovelctr Жыл бұрын
Omg, this is so splendid! This is the first time I've watched your video, and I immediately subscribed. Your explanation makes utter sense out of CSS, whereas I'd say CSS seems to make no sense for most devs. Thank you so much for sharing your knowledge.
@jpisello
@jpisello Жыл бұрын
That last thing with the padding on the flex items blew my mind! Learned something new today, so thanks Kevin!
@tk4776
@tk4776 Жыл бұрын
The last tip, where flex let more control to child and/or siblings, and grid allows more control to the parent was so illuminating. I know now how to initiate a layout based on my content.
@petarkolev6928
@petarkolev6928 Жыл бұрын
Kevin, you are my CSS God!!! I am learning from you more than I have learned so far in my 5y front-end career, THANK YOU!!!
@aarondeimund6898
@aarondeimund6898 Жыл бұрын
Thanks for making these! I'm a developer in the I.T. department of a manufacturing company and the only one on my team with a good grasp of css, largely because of your videos. Thanks for helping me make my corner of the internet a little more awesome!
@babalolasherrifdeen7865
@babalolasherrifdeen7865 Жыл бұрын
Keep it up
@CloudyInside1902
@CloudyInside1902 8 ай бұрын
I'm beginning to learn html and css, your tutorials have been really helpful and are inspiring me to create and learn more and more, thank you ^^
@Tina-van
@Tina-van Жыл бұрын
This is such a good video by someone who deeply understands how things operate in CSS. Thanks a lot!!
@sherryab3964
@sherryab3964 Жыл бұрын
I need this refresher right now 100%! Also, thank-you for the responsive drip course!
@pcartisan2721
@pcartisan2721 Жыл бұрын
This lesson is so important. I had the thought that it might be a good lesson to slip into the beginning of a young developer’s journey. Or, at least a modified version to warn them about the amazing peculiarities to come. 😃
@zorokutend
@zorokutend Жыл бұрын
Thanks Kevin for explaining some of the most confused things of CSS . I think you should add the link to the course in the description. It might help people reach to the course easier. As well as make your video become more friendly to search engine.
@FrankKynard-yf9yu
@FrankKynard-yf9yu Жыл бұрын
I couldn’t tell you how many times does threw me off in the last year. Thank you so much.
@nostalgicnow6001
@nostalgicnow6001 Жыл бұрын
I understand css finally and it’s thanks to you 🙌🏾
@justnormi5605
@justnormi5605 Жыл бұрын
reaaaly like how the lights are setup ! and great video asusal
@saroj_kumar
@saroj_kumar Жыл бұрын
Great stuff for someone who is starting out and facing common issues in CSS.
@joshhoffer
@joshhoffer Жыл бұрын
kevin im falling madly inlove with you ... because you always get me out of the bind , css will never be close to my heart...
@PicSta
@PicSta Жыл бұрын
An excellent video showing the differences. Thanks for this simplified explanation of this difference. I really prefer CSS grid for the rough layout and the content can be arranged with flex then. And I think this is the way it meant to be, right?!
@itspawanpoudel
@itspawanpoudel Жыл бұрын
Your demo website look better than my actual website, By the way thanks for the video, I got stucked in that while updating my portfolio
@joao_penas
@joao_penas Жыл бұрын
Amazing explanation! Everything it's about relationships! 😁 Keep going. Best regards.
@alexjulius69
@alexjulius69 Жыл бұрын
It's to make a fk ton of money from front end development, and you're helping me a great bunch, thanks. I'm not a beginner, but I still struggle with sh*t not working sometimes and this explains A LOT.
@codewithfan
@codewithfan Жыл бұрын
very clear explanation, thanks for it...
@yzap_
@yzap_ 7 ай бұрын
THANK YOU FOR YOUR KNOWLEDGE
@designnimbus
@designnimbus Жыл бұрын
Thanks for a thousand times ❤️
@a5tr00
@a5tr00 Жыл бұрын
I basically started learning about CSS from your videos. And time to time I hear people say “I hate css”, “it is so frustrating” etc… Man, I don’t understand them… Is it because you, Kevin, makes CSS look so easy , simple and lovely? I don’t have any other explanation:)
@TroenderTass
@TroenderTass Жыл бұрын
You don't understand people get tired of hasseling around with stupid layouts and inconsistent properties that might not even work un certain elements, or in certain browsers, when they can do more interesting programming in stead?
@0500MUSIC
@0500MUSIC Жыл бұрын
@@TroenderTass Hahaha right! It’s a massive pain is the ass. people go on like we hate CSS for no reason.
@chinmayghule8272
@chinmayghule8272 Жыл бұрын
Excellent video. No wonder you are CSS King!
@thisurathenuka8362
@thisurathenuka8362 Жыл бұрын
Thank you so much. Could you please do a video on how you approach adding CSS to a UI ? So many ways to do stuff. It's really overwhelming 😥
@zorgivanov8685
@zorgivanov8685 Жыл бұрын
super good vid, thanks!
@o_o_f_c_i4822
@o_o_f_c_i4822 Жыл бұрын
I have no money to buy premium courses so I day I found your channel and you help me a lot . I just become a frontend developer or css expert because of you and designs course KZfaq channel Thank a lot
@KevinPowell
@KevinPowell Жыл бұрын
So glad that my content has been able to help you out! 😊
@o_o_f_c_i4822
@o_o_f_c_i4822 Жыл бұрын
@@KevinPowell Thank you sir I am so happy 😊. I would like to give you a small fee do you have your active Patreon
@Pyrospower
@Pyrospower Жыл бұрын
Thank you so much!
@thefootles
@thefootles Жыл бұрын
Awesome, thank you!
@NiceChange
@NiceChange Жыл бұрын
Thanks Kevin..great tips for development...🙂
@pelumiamos6868
@pelumiamos6868 Жыл бұрын
I need this a lot thanks very much .
@mikeb2604
@mikeb2604 Жыл бұрын
I'm learning so much in this video o_o
Жыл бұрын
That padding in flex really caught me by surprise. What if the padding is applied to a div nested within the flex child? Would it still cause issues? Great video btw.
@Bkamron
@Bkamron Жыл бұрын
I'm kinda happy I started CSS way back I'm the late 00s I still use techniques from the XHTML days (remember those days?) And the somehow still kinda work for me. If I had to learn all over again, it would be so daunting I'd probably give up.
@bertlemoi431
@bertlemoi431 Жыл бұрын
the secret key to mastering css is watching all the videos kevin makes - easy.
@omaracelys3217
@omaracelys3217 Жыл бұрын
Amazing video, very few videos like this.
@Dev-Phantom
@Dev-Phantom Жыл бұрын
it was cool to know the depth, i have to do it
@MaddyChessVision
@MaddyChessVision Жыл бұрын
we want 21 days responsive layout type of course. that was great❤❤
@kevinpellerin6715
@kevinpellerin6715 10 ай бұрын
Thanks man, you are from Halifax too. I like your videos
@marcusantenor793
@marcusantenor793 Жыл бұрын
So much wisdom in just 17:10mn, thanks Bro!!!
@amirkamalian8045
@amirkamalian8045 Жыл бұрын
Hey dear Kevin! Lovely video as always. Will you ever release your new course? 😅
@keaton718
@keaton718 11 ай бұрын
I can totally imagine Kevin applying all these tips to Mrs. Powell.
@m12652
@m12652 Жыл бұрын
Brilliant! thanks again…
@beinfomaniac7182
@beinfomaniac7182 Жыл бұрын
thanks kevin
@danielgarner100
@danielgarner100 2 ай бұрын
I loved this
@octothorpe12
@octothorpe12 Жыл бұрын
That's I think the important thing to consider: Flex is 1D, so it gives you the illusion of columns. They'll only ever look like true columns if you explicitly make them all the same (and even then everything gets wild when items wrap). If you want 'set and forget' true columns, you kinda need to go Grid.
@securefolder4548
@securefolder4548 Жыл бұрын
Thanks to u im now good at css 💖💖
@sugaslate14
@sugaslate14 11 ай бұрын
Your videos inundate my CSS playlist hahahaha
@nomadshiba
@nomadshiba Жыл бұрын
i always use grid or flex and use block and inline-block, inline and stuff, basically the default displays only if im actually rendering an article, a document etc basically what html has been made for originally other than that everything is always inside a grid mostly flex is only useful if stuff has dynamic different sizes, based on content, such as navigation menu, tags list, or such
@TundeEszlari
@TundeEszlari Жыл бұрын
You are a very good videographer.🤗❤
@KevinJTurner
@KevinJTurner Жыл бұрын
Love the t-shirt!
@johnconnor9787
@johnconnor9787 Жыл бұрын
Waiting for the video on CSS nesting :)
@danielgarner100
@danielgarner100 2 ай бұрын
Great video
@glebpanchenko5500
@glebpanchenko5500 Жыл бұрын
cool, you are a great teacher
@last.journey
@last.journey Жыл бұрын
One thing that helped me a lot to understand some of this topics Is making a layout from figma skitch
@Michaelbhand
@Michaelbhand Жыл бұрын
Thanks!
@KevinPowell
@KevinPowell Жыл бұрын
Thank you so much!
@George10767
@George10767 11 ай бұрын
I have discovered that the tags "div" and "article" have identical functions. Please say if you disagree. Also you can put a "div" function inside a "div" function, and a "article" function inside an "article" function. Also, of course, you can put an "article" function inside a "div" function and vice-versa.
@Zakaros1000
@Zakaros1000 Жыл бұрын
Coffee time with a Powell's video ☕
@HellXandre
@HellXandre Жыл бұрын
Hi :) i'm a french guy who try to learn a little in this numeric world x) but i dont have a very good lvl for that ahah ^^ I discover your channel this...year and...for me your channel is cool, tricks and good question help me a lot ^^' i dont understand all all, because my english is poor, rreally x) but you explain very well, thanks you for that :)
@Kriptokeeper
@Kriptokeeper Жыл бұрын
I love your videos they are the most in-depth and easiest to follow could you do a connect wallet button to your web page for metamask tutorial PLZ Java has me going nuts and no one does a very great tutorial I’m on windows I’ve got npm downloaded and my node says it’s running but keep getting crazy errors when I command npm run dev? Very frustrated and confused sorry for the rant
@EricRohlfs
@EricRohlfs 8 ай бұрын
30 years and I never thought about it about width an height had inverse relationships with children. Mind blown
@avmalik3705
@avmalik3705 Жыл бұрын
Amazing
@markwerle
@markwerle Жыл бұрын
What tool are you using at the end to show the red overlay of the gap, px size, etc?
@GEO-42
@GEO-42 Жыл бұрын
Thank you so much for all your videos ! I would love to see how you develop a real world production ready web app with js, HTML ans CSS. I say that because as a react developer i want to stop using components libs like MUI and code my own one. Can you explain how to do that ? Thank you Kevin
@spirit1292
@spirit1292 Жыл бұрын
Great video! I also don't get one css feature. I don't really understand why vertical padding of a child is getting calculated based on it's parent width???
@paulknol
@paulknol Жыл бұрын
Wow Kevin, really nicely explained. I have been doing these kind of things rather instinctively and successfully but never really breaking it down this way. I acutally had a few “oh right” moments. Thanks for joggin the ol’ noggin
@KevinPowell
@KevinPowell Жыл бұрын
Yeah I think a lot of the time, it clicks for some people on a more instinctive level, which is great when it happens!
@uwakmfonessien6610
@uwakmfonessien6610 Жыл бұрын
Greetings Kevin. Please how can I get the source code of the html, css and javascript you used in teaching us. I want to get along with you because sometimes your screen division covers part of the code. Thanks for your kind contribution in the world of web development!!!
@TheMetalMag
@TheMetalMag Жыл бұрын
u're the master
@mehdi-vl5nn
@mehdi-vl5nn Жыл бұрын
10:07 flex also has impact on position ! and god knows what else
@someone5502
@someone5502 Жыл бұрын
I wish I could use grid and more up to date features but I always have to cater for IE, and older browsers, as most sites I cater to at work are business sites. I love web development but I hate how it takes years before I can actually start using certain things.
@michaelgleason4791
@michaelgleason4791 Жыл бұрын
"Not just throwing display flex at something in columns and hoping everything works out." I feel attacked. Great video as always.
@spiritualforce
@spiritualforce Жыл бұрын
Thanks
@shubhamchandel-gs4so
@shubhamchandel-gs4so Жыл бұрын
this guy is equipped in making you feel like an idiot. does not matter how much experience you have.
@christopherportorreal
@christopherportorreal Жыл бұрын
@kevinPowell I have a problem when starting to design. I'm practicing with Frontend Mentor, and the designs are normally created with Mobile: 375px and 1440px widths. How should I start setting the right space to work? Should I use max-width or just the width at the beginning?
@Fleshbits1
@Fleshbits1 4 ай бұрын
Do you have a video that explains how you are seeing your results, editing css, etc. for noobs? Looks like you have the css open as a tab in vscode and the page open in something else? It refreshes automatically?
@ginamdar
@ginamdar Жыл бұрын
I know its not much but Kevin you can buy timy . Thank you so much..the crux of this video for me to learn more about collapsing margins!
@KevinPowell
@KevinPowell Жыл бұрын
Thank you so much!
@TheOne-qv3xw
@TheOne-qv3xw Жыл бұрын
liked before watching!!!
@itspawanpoudel
@itspawanpoudel Жыл бұрын
As always 😂
@a99986
@a99986 10 ай бұрын
legend
@fliptip
@fliptip Жыл бұрын
so a good video
@danielpedersen1688
@danielpedersen1688 Жыл бұрын
what font are u using in ur code editor? want to use it in mine. Thanks!
@mali_gaurav
@mali_gaurav Жыл бұрын
What is best think for learning plan css or css framework
@ricardoolartepuell2011
@ricardoolartepuell2011 Жыл бұрын
for the even columns with flex:1, can we use a wrapper in each element, and the wrapper child content put the padding? Ill test it
@FunDumb
@FunDumb Жыл бұрын
Collapsing margins sounds like my life.
@JIu4Ho
@JIu4Ho Жыл бұрын
I just started learning CSS and sometimes positioning is really hard and objects dependency. Especially when you apply some rules and they don't do anything 😂
@devchannel5232
@devchannel5232 Жыл бұрын
In my point of view the most frustrating thing is positioning/responsiv positioning, but maybe because i am still a css noob :D
How to take control of Flexbox
16:01
Kevin Powell
Рет қаралды 114 М.
Learn CSS Grid the easy way
37:04
Kevin Powell
Рет қаралды 877 М.
Luck Decides My Future Again 🍀🍀🍀 #katebrush #shorts
00:19
Kate Brush
Рет қаралды 8 МЛН
OMG🤪 #tiktok #shorts #potapova_blog
00:50
Potapova_blog
Рет қаралды 17 МЛН
MEU IRMÃO FICOU FAMOSO
00:52
Matheus Kriwat
Рет қаралды 37 МЛН
6 things I wish I knew about CSS when I started
9:09
Kevin Powell
Рет қаралды 224 М.
Responsive Flexbox Layout in 2 Minutes
2:41
SolarDev
Рет қаралды 21 М.
The 6 most important CSS concepts for beginners
28:58
Kevin Powell
Рет қаралды 151 М.
Learn Flexbox CSS in 8 minutes
8:16
Slaying The Dragon
Рет қаралды 1,4 МЛН
CSS Grid Template Area Tutorial Speedrun
1:00
Hyperplexed
Рет қаралды 741 М.
Container Queries are going to change how we make layouts
24:24
Kevin Powell
Рет қаралды 170 М.
3 modern CSS techniques for responsive design
14:32
Kevin Powell
Рет қаралды 211 М.
Flexbox or grid - How to decide?
18:51
Kevin Powell
Рет қаралды 705 М.
The different types of JavaScript functions explained
14:47
Kevin Powell
Рет қаралды 36 М.