Why CSS grid-area is the best property for laying out content

Sdílet
Vložit
  • čas přidán 3. 08. 2024
  • CSS Grid is amazing, and grid-area just make it so much better. When grid first launched I loved the idea of grid areas, but didn't get fully on board as it seemed like a little too much work... but once you start actually using them on a regular basis, you realize that while the initial setup in slightly longer, in the long run you can save a boat load of time!
    Join the party in the community: / discord
    The code from this video: codepen.io/kevinpowell/pen/qL...
    CSS-Tricks article on autoprefixer and grid for IE: css-tricks.com/css-grid-in-ie...
    ---
    I have a newsletter! www.kevinpowell.co/newsletter
    New to Sass, or want to step up your game with it? I've got a course just for you: www.kevinpowell.co/learn-sass
    ---
    My Code Editor: VS Code - code.visualstudio.com/
    How my browser refreshes when I save: • How to automatically r...
    ---
    Support me on Patreon: / kevinpowell
    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 CZcams channel, make sure to follow me on Instagram and Twitter.
    Instagram: / kevinpowell.co
    Twitter: / kevinjpowell
    Codepen: codepen.io/kevinpowell/
    Github: github.com/kevin-powell

Komentáře • 273

  • @RameenFallschirmjager
    @RameenFallschirmjager Před 4 lety +4

    Your shirt is a reminder of css grid too! And one the buttons is unbuttoned!🤣

  • @bud384
    @bud384 Před 3 lety +39

    4:45, 6:16 => grid template columns & grid column;
    7:19 => grid template areas;
    13:57 => firefox;
    17:19 => the reason why you want to use grid template areas;

    • @giuzp95
      @giuzp95 Před rokem

      Thanks for making timestamps! It's a huge help for me when reviewing.

  • @farn451
    @farn451 Před 4 lety +13

    i'm falling in love with CSS again. it used to be a full on nightmare trying to do layouts back when i first learned but HTML and CSS is awesome and i'm getting into Sass too so really digging your vids.

  • @HostDotPromo
    @HostDotPromo Před 5 lety +30

    CSS grid is a massive improvement! 👍

  • @TobiasLauner
    @TobiasLauner Před 5 lety

    Hey Kevin,
    thank you very much for bringing me GRID-AREAS closer. I was approaching the same way like you, thought, I don't need the areas and can work around it. But you showed once more, how easy it is, to use them in an easy way! AWESOME!!! Thank you, Kevin!

  • @chrishare3273
    @chrishare3273 Před 5 lety +7

    Wow this really shakes up my whole design process. Thank you for making this video!

  • @NeroIvanY
    @NeroIvanY Před 5 lety +23

    Congrats on 50k subs, Kevin! I'm on this channel since it was 10 times smaller and It's great to see how it is growing! You have your own special atmosphere on the channel. It really feels like you want us to understand the subject. It's motivating. Thank you so much!

    • @KevinPowell
      @KevinPowell  Před 5 lety

      Thanks for sticking with me for so long!

    • @tech3425
      @tech3425 Před 2 lety

      Now its 10 times larger

    • @mdzaid3880
      @mdzaid3880 Před 2 lety

      Hey just a reminder , now it's another 10x ... Kevin Sir deserves this , he is a great teacher🔥

  • @shahbokhari
    @shahbokhari Před 5 lety +12

    You are doing just Great! We are with you.

  • @luiscolome75
    @luiscolome75 Před 3 lety +1

    That is the best explanation and minimalist (in a good way) video tutorial about what Grid Areas I've ever seen. I wish I could give you 100 likes. Thanks million Kevin for your work!

  • @sergeysachkov7388
    @sergeysachkov7388 Před 5 lety +3

    I've watched several of your videos, I feel I'm starting to love grid. Thanks! Nice job

    • @liszcgsedt
      @liszcgsedt Před 4 lety

      As a supplement, check out Jen Simmons. She is more theoretical but does also give a good idea what way you can think when employing grid.

  • @anthonyortiz7924
    @anthonyortiz7924 Před rokem

    Just came across your content and I want to say that you're doing a great job explaining each topic; thank you!

  • @benwvrd
    @benwvrd Před 5 lety +2

    Recently learnt about grid areas and how to use them. This video really helps me understand clearly how it all works! Thank you so much, definitely subbed! 😁

    • @KevinPowell
      @KevinPowell  Před 5 lety +1

      Glad you enjoyed it enough to sub Ben!

  • @AdolfoBarreto75
    @AdolfoBarreto75 Před 5 lety +2

    Your not the only one! I'm also in-love with it!

  • @marcelvanlierop
    @marcelvanlierop Před 5 lety

    Love the vid Kevin. You re-sparked my interest. Thanks!

  • @jamesrosemary2932
    @jamesrosemary2932 Před 5 lety +23

    I was holding back the use of grid feature because of browser support. But I see now that 90% of browsers in the wild have support without prefixes so I start using grids in production now.

  • @amyp.575
    @amyp.575 Před 4 lety +2

    You are talking about having 50k subscribers in January and now look at you with over 95k!!!Go, Kevin, Go!!

  • @egemenaydinlioglu7231
    @egemenaydinlioglu7231 Před 2 lety

    Hi.. I keep watching most of your videos.. Thank you for making me love CSS ! i had no idea before what is CSS or HTML. After a few class in school i found out your channel and keep learn new thing every day !! thanks for videos

  • @MRMOTOFOTO
    @MRMOTOFOTO Před 4 lety

    Finally decided to learn CSS grid today and after seeing this and playing around with it....wow grid areas!! So awesome!

  • @abrahamf6124
    @abrahamf6124 Před 5 lety +2

    Great video, grid-areas are very handy. I learned many things from this video and defenetly going to apply them in my next project. Subscribed.

    • @KevinPowell
      @KevinPowell  Před 5 lety +1

      Glad you learned a few things, and welcome aboard!

  • @fortestingpurposesonly2697

    Recently found your channel, really enjoy the content! Keep em coming ^^

  • @alanjb5791
    @alanjb5791 Před 5 lety +1

    you are my go to resource for UI development. Thank you so much!

  • @nonchalant8473
    @nonchalant8473 Před 5 lety +3

    Great content Kevin. Thank u!

  • @lisap5615
    @lisap5615 Před 9 měsíci

    I love your videos! I have learned so much from you. I am currently taking a CSS class online from a university, and I often use your videos to help me understand many of the topics better, such as Grid and Sass. Thank you so much! When I am done with my university classes, I am going to take some classes from you to improve my CSS skills.

  • @verawat
    @verawat Před 3 lety +2

    Kevin Powell having 50k subscribers in January 2017
    but right now 17/4/2021 look at it over 247k!!! Go, Kevin, Go Go !!I love you.
    I came from THAILAND

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

      2024 and 913K

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

      ​@@narenprakash6732 Before the end of year 2024 I think it should 1M ++ subscribers (Sure Sure)

  • @nikhiltyagi1080
    @nikhiltyagi1080 Před 5 lety +98

    50k is not good enough...you deserve 500k subs!!

    • @nikhiltyagi1080
      @nikhiltyagi1080 Před 5 lety +1

      @Keytron Quabius yeah I guess you are right. What you said..the same thing thing happened to devtips. It became so big..That Travis couldn't manage it, felt burnt out and decided to leave the channel. Now the channel is just a shadow of its former self

    • @KevinPowell
      @KevinPowell  Před 5 lety +3

      If you guys haven't joined us over on Discord I recommend you do 😁. Even if I can't keep up with everything here as much, I figure it'll only be a small fraction of the audience over there, which will help keep some good discussions and stuff going 😁

    • @AdolfoBarreto75
      @AdolfoBarreto75 Před 5 lety

      On youtube it really is just a matter of time. Maybe one more video a week would increase your views. Why don't you ask us what we need to know. It's a great way to tune into your audience.

    • @KevinPowell
      @KevinPowell  Před 5 lety +4

      I'm always open for suggestions Adolfo :). And 1-2 videos a week is good for me. It's nice to grow, but it's not what I do it for :D

    • @Ferskvand
      @Ferskvand Před 5 lety

      Nikhil Tyagi i second that👍

  • @kerryd2060
    @kerryd2060 Před 5 lety

    Great videos! Thank you for doing them.

  • @dawniebug784
    @dawniebug784 Před 2 lety

    I hope I remember to come back to this exact video when I move onto the responsiveness of the site I'm working on. I love your videos! Thank you so much! It's really difficult coding but I'm really really getting a hang of it thanks to you

    • @happycakes1946
      @happycakes1946 Před 2 lety

      Just a warning, it's harder to add responsiveness after you write your css than before you do. The sooner you do it the better.

  • @prateekmishra6245
    @prateekmishra6245 Před 3 lety

    Now I love grid areas. Thank you Kevin.

  • @scyfox.
    @scyfox. Před 2 lety

    I loved the video and also the sass part. So neat and organized

  • @jonathanhammond5563
    @jonathanhammond5563 Před 11 měsíci

    Thanks Kevin! As always you have helped me better understand and implement CSS

  • @shahabemami4275
    @shahabemami4275 Před 5 lety

    I'm learning from you man. keep it up . and that real example was great

  • @rubhan94
    @rubhan94 Před 5 lety

    Nice video! I think I'll start using grid-area as well, I also thought it seemed tedious to do it that way but this proved it wrong haha.

  • @faissalabsml4393
    @faissalabsml4393 Před 5 lety

    Great explanation as always. Thank you

  • @obNiall
    @obNiall Před 5 lety

    Excellent as always kev

  • @iansullivan9738
    @iansullivan9738 Před 3 lety

    Kevin, you correcting you screen only - only screen error helped me fix a problem I've been having with media queries for a week.

  • @sharpenednoodles
    @sharpenednoodles Před 4 lety

    Just subscribed to your SASS Scrimba course after you gave a peek in this video, it looks fantastic, I am v excited

  • @senkasim
    @senkasim Před 5 lety

    after that I will use the grid in my projects. Thank you very much for the video.

  • @kandysman86
    @kandysman86 Před 5 lety +1

    I love grid areas. No matter what, it just works. Edit: great channel man, subbed.

  • @mikewoolf8071
    @mikewoolf8071 Před rokem

    Watching this now and you have 671k subs to date in only 3 years lol.. congrats!

  • @chantalwiebe534
    @chantalwiebe534 Před 2 lety

    Here from yesterdays video. This was so helpful! Subscribed!

  • @marslogics
    @marslogics Před 5 lety

    Loved your content. Thank you.

  • @boggeshzahim3713
    @boggeshzahim3713 Před 4 lety +4

    I can't believe that a year ago I was using floats and margins for all of my layout needs, it's crazy that with your tutorials and a few personal projects I've improved so much already

  • @Super100JKO
    @Super100JKO Před 4 lety +3

    Using Ditto will save you so much time and trouble when copying stuff :D
    Love your work! Keep it up! :D

  • @sarrii2912
    @sarrii2912 Před rokem

    congratz on 50k ! lets go 1mil goal now !

  • @3208nandu
    @3208nandu Před rokem

    You are the best CSS Tutor/guide/ teacher/mentor on YT

  • @champolot
    @champolot Před 5 lety +1

    At the end of the video. I was like.... Ooookkk??? Hahaaha. It went too fast for me. But I would say that you're a great teacher. Thanks for sharing always

    • @KevinPowell
      @KevinPowell  Před 5 lety

      Sorry if I went a bit fast, I'll eventually do a CSS grid for beginners series or something that really goes through the entire thing nice and slowly :)

    • @djhonz45
      @djhonz45 Před 4 lety

      Likewise! Feel like I’m back to square one again lol.

  • @jazzyhampton8732
    @jazzyhampton8732 Před 3 lety

    I am a beginner and building my first website. This is great because I keep changing my layout. It is simple. Thank you so much. I will also give you credit. 🤗✌😉

  • @codeitraw5241
    @codeitraw5241 Před 2 lety

    50k subs 2 years ago. Now it’s over 300k that’s pretty good. 🥳

  • @leahthegeek9677
    @leahthegeek9677 Před rokem

    thank you so much this is amazing.

  • @meepk633
    @meepk633 Před rokem

    I do the same thing! I have a big sass file with a bunch grid-template mixins. Each one takes arguments for the name of the objects and the alignment/margins. If you don't pass names in, they use a "standard" 4 letter codes for area names. It makes uniform responsive components so much easier. Sass is great. I can get carried away.

  • @dlevz
    @dlevz Před 2 lety +1

    I love how your shirt has display: grid;

  • @captainzappa8561
    @captainzappa8561 Před 3 lety

    you are a God - thank you for this it has saved me so many hours

  • @LubosKadasi
    @LubosKadasi Před 4 lety +3

    11:46 [Win + v]
    p.s.: Thank You for new knowledge.
    L.K.

  • @rembautimes8808
    @rembautimes8808 Před 2 lety +1

    Kevin: I planned a 50K video. Community: Not its worth 500K. Thanks for the great tutorial as you help to clearly explain CSS concepts.

  • @VideoNOLA
    @VideoNOLA Před rokem

    Title says "Grid-Area" but tutorial initially talks about "Grid-Template-Areas". Came here looking for the former one, which is way more compact. Happy to see it appear around 14:45, but not the 1 / 1 / 2 / 4 type I'd hoped to understand better.

  • @mujtabac5
    @mujtabac5 Před 5 lety

    much love from someone who hates UI , i think you make me love css now

  • @zacheryperry5531
    @zacheryperry5531 Před 4 lety

    Your button was undone and it was driving me insane haha!

  • @crooker2
    @crooker2 Před 5 lety +3

    I've loved css grid since it rolled out last year. I have a lot of anxiety (as you mentioned) about browser support.
    Bootstrap 4 is still my layout framework of choice (as well because of the added dynamic components)... And I have used them both together.
    Anyways... I'm going to check out your discord. Thanks for your channel!

    • @codeme8016
      @codeme8016 Před rokem

      I used to use Bootstrap or Angular Flex-layout on my projects. The only reason moving to Flexbox or Grid is that I don't want to layout the pages in the HTML files anymore. Even Google is dropping their Flex-layout package from Angular v15+ for the very reason of Separation-of-Concerns. Honestly my HTML files look very nasty with those Bootstrap or Angular Flex layout commands. I'll be using their components from now on only and no more styling.

  • @Zacban
    @Zacban Před rokem

    4 years later Kevin is at 758K ;)
    Well deserved

  • @SteveSonoa
    @SteveSonoa Před 5 lety +2

    I'm going to be moving my personal project to grid starting in February thanks to your videos!

    • @KevinPowell
      @KevinPowell  Před 5 lety +1

      Very awesome Steve! Have fun, it's great to work with (IMO anyway)

  • @KentaroxKondo
    @KentaroxKondo Před rokem

    I enjoy your videos in Japan!

  • @Fliteska
    @Fliteska Před 5 lety

    I figured I was already subbed to you as I watch at least 5 random videos of yours each week... Turns out I wasn't but now I am. This was when you had hit 50k and as of this comment, it's 73k!

    • @KevinPowell
      @KevinPowell  Před 5 lety +1

      Glad you've been enjoying them enough to sub! Things are growing here every day, really exciting :D

  • @paytonhuhta
    @paytonhuhta Před 4 lety

    Good content gets you subscribers. Keep up the good work!

  • @moseskoroma6092
    @moseskoroma6092 Před 4 lety

    kevin that awesome i wish i could be like you or more than you, but any way am on it thanks bro you are doing absolute great me and my brother love your stuff.

  • @mortkebab2849
    @mortkebab2849 Před 4 lety +1

    I use:
    @media screen and (max-width: 860px) and (orientation: portrait)
    for the case where the areas stack in a "column" because when the phone is turned to a landscape orientation it is able to display main and sidebar side-by-side just like a desktop (and doesn't require a media query) but "width" is the smaller of the two dimensions of the phone regardless of which way it is held.

    • @KevinPowell
      @KevinPowell  Před 4 lety +2

      I don't have that experience with mobile devices....

  • @GifCoDigital
    @GifCoDigital Před 5 lety +161

    Video starts at 2:15

    • @RIWIX
      @RIWIX Před 5 lety +7

      Yeah if they could put that at the end of the video would be great.

    • @ShotgunAFlyboy
      @ShotgunAFlyboy Před 5 lety +5

      holy bloatware batman

    • @balazsotvos2530
      @balazsotvos2530 Před 5 lety +2

      thx

    • @BabyBearRudy
      @BabyBearRudy Před 5 lety +1

      Damn I read this at the 2 min mark lol

    • @UninexusInc
      @UninexusInc Před 5 lety +2

      I saw it immediately and saved 2:15 of my precious life... ;-)

  • @GR_BackingTracks
    @GR_BackingTracks Před rokem

    KP: "...we hit 50,000 subscribers." -- I'm watching this and you have 664k.
    Greatness shines!

  • @josema-boy7610
    @josema-boy7610 Před 4 lety

    Congratts on the 50K Subscribers!!! Thank you for the videos. Make a 50K layout site!!! lol

    • @KevinPowell
      @KevinPowell  Před 4 lety

      Passed 100k now 😁
      I wish I had more time to build out something special to celebrate

  • @carlosrangel4500
    @carlosrangel4500 Před 2 dny

    Awesome content :)

  • @boggeshzahim3713
    @boggeshzahim3713 Před 3 lety +3

    I wish I could convince my coworkers to use grid, but since we use react with material ui it makes more sense to stuck to flex since that's what that uses

  • @crousdioll
    @crousdioll Před 5 lety

    Amazing channel

  • @ryandick6389
    @ryandick6389 Před 3 lety

    Amazing videos

  • @madisonhite510
    @madisonhite510 Před 3 lety

    I'm obsessed with grid-area also! it made css grid for click for me within 5 minutes and css grid is like my baby

  • @aminbe3960
    @aminbe3960 Před 2 lety

    Thank you Kevin for reaaaaaally excellent content :)
    I would use grid-template-area if I have a finite set of elements to manage ... Otherwise (for example a random set of cards, e.g. in e-commerce websites ... ), I would go for grid-template-rows/columns ...

  • @andreiradufrandes2176
    @andreiradufrandes2176 Před 5 lety

    keep at it sir;)

  • @hourofglory969
    @hourofglory969 Před 5 lety

    Thanks for your good works, Is it advisable to continue using grid though is not supported by all browsers. I love your videos

  • @AA-em3lw
    @AA-em3lw Před 3 lety

    loved it, Thank you Kevin (=

  • @SridharKatakam
    @SridharKatakam Před 5 lety

    A few tips for you: 1) use a clipboard manager like Pastebot and set it to show previously copied 10 items when you press cmd+shift+v 2) Use TextExpander to expand commonly used stuff like the media query declaration. You can even have the text cursor go to where the number should be.

  • @TrisnoadiWikantoro
    @TrisnoadiWikantoro Před 5 lety

    Watching your vids always reminds me of Le Tongue

  • @Glow0110
    @Glow0110 Před 5 lety +11

    What tools do you use to build websites? Would be awesome to see a breakdown of your workflow and tech stack from start to finish.

    • @liszcgsedt
      @liszcgsedt Před 4 lety

      HTML editor (whatever stuff highlighting syntax), browser and Gimp for images should do, I rarely use anything else ... but would be interested too as I may not be superbly productive. Especially as I only have an idea in my head and a rough sketch and do not bother with any Adobe stuff (or whatever you use to make a visual draft).

  • @lowercaseguy3578
    @lowercaseguy3578 Před 3 lety

    Ok brother they're awesome

  • @benvolz5003
    @benvolz5003 Před 5 lety

    Hay, cool tutorial in your experience what would you say would be the way to manage comtent (i.e update articals and add new ones) for a web site you design your self?

  • @imanibrahim6
    @imanibrahim6 Před 5 lety

    Hi Kevin I’m learning web development but really confused as there is css and bootstrap. Was wondering if companies want you to know bootstraps and use it for project or they want you to write codes from scratch without the use of any libraries. Ur videos are great and informative. Just found out recently and I’m watching every video. Thx man keep up the good work and plz elaborate my confusion hope you can help me

  • @Sonnerick2k
    @Sonnerick2k Před 5 lety +1

    Hello there.
    I just installed your code editor, this is awesome! Thanks!)

  • @FreeSkypeGenerator1
    @FreeSkypeGenerator1 Před 2 lety

    thanks for the video
    0:05 not sure why you looked like Joey Tribbiani for a second lol

  • @giakhanh2664
    @giakhanh2664 Před 2 lety

    great!

  • @FirebrandVOCALS
    @FirebrandVOCALS Před 4 lety

    Subbed

  • @fatihsamancioglu
    @fatihsamancioglu Před 2 lety

    First 9 seconds is epic 👌😅

  • @justinewert2166
    @justinewert2166 Před 5 lety +3

    Can't wait for Subgrid to finally get launched, hopefully soon :)

    • @KevinPowell
      @KevinPowell  Před 5 lety +1

      I'm happy it shipped without it, so that they could ship it as fast as possible... but yes, subgrids are going to make life sooo much easier.

    • @ralexand56
      @ralexand56 Před 5 lety +2

      @@KevinPowell I wish they also allowed animation of grid layout changes.

    • @hughslooskant4420
      @hughslooskant4420 Před 5 lety +1

      @@ralexand56 can animate grid-gap

    • @kandysman86
      @kandysman86 Před 5 lety

      @@hughslooskant4420 really?

    • @ralexand56
      @ralexand56 Před 5 lety

      @@hughslooskant4420 Unfortunately that's all it can animate.

  • @ianrelosa2198
    @ianrelosa2198 Před 4 lety

    Hi I'm new to this channel and it's easy to learn with you. Hope you post a crash course about html css and js.

    • @KevinPowell
      @KevinPowell  Před 4 lety

      I have an HTML & CSS crash course on Scrimba that's free :)
      scrimba.com/g/ghtmlcss

  • @erykkryszewski5803
    @erykkryszewski5803 Před 5 lety +3

    thanks you i started to use @supports(display:grid) {} and now my websites are much more effective. they display grid or flexbox, which i autoprefix earlier. there is no chance that even explorer breaks the layout now :D but ofc im waiting for grid to be supported by every browser, it would be 2 times faster to build layouts with it

  • @davitjanashia9344
    @davitjanashia9344 Před 4 lety

    Wow man, we have 132k subscribers.. I'm so glad that we achieved so much in our life :D

  • @anthonymarquez2542
    @anthonymarquez2542 Před 3 lety

    Oh boy a mention of 50k, homie is nearing 300k now. How things progress in such short time

  • @robdl9149
    @robdl9149 Před 3 lety

    Hi Kevin, thanks for your wonderful videos. I have been trying to find the video you did on the "Travel Food Fun" website mentioned in the "Why CSS grid-area is the best property for laying out content" video . If you could point me in the right direction that would be good.

  • @nathancornwell1455
    @nathancornwell1455 Před 4 lety

    So, unfortunately i came along after your sass course and i was unable to check that out. Do you have any plans for other courses in the future? The responsive web design bootcamp was fantastic.

  • @JR-mk6ow
    @JR-mk6ow Před 5 lety +6

    I prefer flex-boxs. I mean, it depends on the use tbh. I use a lot more horizontal stuff so it easier to use flex boxs with different flexs

    • @KevinPowell
      @KevinPowell  Před 5 lety

      I find I'm using grid more and more thanks to stuff like minmax(), grid-gap (coming to flexbox!) and the fr unit

    • @lalnuntluangachhakchhuak5767
      @lalnuntluangachhakchhuak5767 Před 5 lety

      Flexbox needs to have flex-gap just like grid-gap

  • @priyaranjan1733
    @priyaranjan1733 Před 4 lety

    Hey Kevin, what theme and fonts are you using in this VS Code?
    it feels like Atom!!

  • @Atman89
    @Atman89 Před 3 lety

    CSS grid is dope

  • @michalnowak2181
    @michalnowak2181 Před rokem

    thx

  • @Tpendleton13
    @Tpendleton13 Před 2 lety

    0:07 seconds.... convinced.