STOP The CSS Grid Confusion - 2 Ways to GRID!

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

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

  • @DesignCourse
    @DesignCourse  4 года назад +111

    Omg I'm at 499k. Much excitement I guess? Help me hit that mark by subscribing if you enjoyed this!

    • @nilen
      @nilen 4 года назад

      I need to make a 3 column website 2 column, how?

    • @jeromeclaveau3519
      @jeromeclaveau3519 4 года назад +1

      Well deserved, thank you for providing quality educational content on a regular basis.

    • @Mark33090
      @Mark33090 4 года назад

      I can't subscribe now to help you reach 500K, sorry... because, I AM ALREADY SUBSCRIBED OF COURSE!!! Your channel rocks!!!! You make it look so easy and explain everything well... A huge thank you for sharing your knowledge.

    • @pikasingh
      @pikasingh 4 года назад

      Hi Gary, Your channel is perfect match for my needs. As a student I have many questions about FrontEnd and your videos answer them all. Please make one video on making complex template through Bootstrap. It help us to understand the complex part of the development. A Bigg thank you, Gary. 😊

    • @torickjdavis
      @torickjdavis 4 года назад

      @@nilen Using CSS Grid you have a few options. You can define grid-template-areas or use ideas shown in the video with numbered columns and rows. Then, at a break point (from a media query), you can redefine the grid in similar ways. Hopefully this helps!

  • @rudrapratapsinha8880
    @rudrapratapsinha8880 4 года назад +106

    CSS grid is revolutionary.

    • @boukhadc
      @boukhadc 4 года назад +2

      Rudra Pratap Sinha from 2012

    • @MrAndi1281
      @MrAndi1281 4 года назад +8

      @@boukhadc hmm... browser support was just catching up in the last two years! so in 2012, even though it existed, not a lot of support was there.

    • @boukhadc
      @boukhadc 4 года назад +3

      MrAndi1281 yeah 2017 was the year we could say it is supported you are right.

    • @ne9835
      @ne9835 4 года назад

      Yup!!

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

    This is one of those things where you look at several tutorials and see multiple that are not as helpful for whatever reason, maybe you feel like they aren't explaining things well, or they are going about things in this roundabout way, or skimming over some crucial aspect or whatever, or they assume some prerequisite knowledge you may not have, and it just makes it hard to understand 100%. Then you watch this one and it just clicks so much easier like -- "why didn't people explain it this way to begin with." I guess the usefulness of tutorials can vary for lots of reasons including your skill level, but this is the one that helped me the most. Very simple and to the point and easy to follow and I now understand enough about grids that I can immediately begin using them.

  • @adnanamin3666
    @adnanamin3666 4 года назад +44

    Finally 80% grid confusion is solved! Thank you so much!! :)

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

    I've done several grid tutorials and this one really helped the most. You can't set the css correctly when you're just learning grid and more time is spent just giving you a list of attributes. The illustrations made all the difference for me and I'm ready to design my grid now. Thanks!

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

    i dont know how you do it , but bro. YOU EXPLAIN EVERYTHING LIKE YOU ARE TALKING TO 10 YEARS OLD KID, AND IT FCKIN WORKS!!!!!!!!!

  • @JoeMilbachOnline
    @JoeMilbachOnline 4 года назад +5

    Be careful what order you place your HTML elements. Screen readers tend to rely on the actual placement of the HTML tags and not how it is rendered on the page after css. You do a great job I enjoy watching your videos. Cheers and keep up the great work.

  • @Franiveliuselmago
    @Franiveliuselmago 4 года назад +109

    "get the diabeetus in 1 week wth our candies" lmao

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

    Gary Simon: ""Hopefully you enjoyed that..."
    Me: "Ënjoyed is an understatement... I loved every bit of it, especially while coding along, and pausing to wonder why I cant like the video multiple times!"

  • @mawulijo
    @mawulijo 4 года назад +3

    How did you know I was watching your other CSS grid videos? I simply can't believe the impeccable timing of this video. Thanks Garry

    • @DesignCourse
      @DesignCourse  4 года назад +9

      I know because I'm watching you... I watch all of my subscribers -- it's a reciprocal relationship. I know a guy at the NSA.

    • @mawulijo
      @mawulijo 4 года назад +1

      @@DesignCourse Can't say I don't believe you. Can I? Can the NSA guy be a mutual friend? :DD

  • @viktorklymets6630
    @viktorklymets6630 4 года назад +11

    you also can use img instead css background and instead background-size use object-fit property for image

  • @farn451
    @farn451 4 года назад +1

    dude, you're an awesome teacher. i've been using wordpress for years and back in the day i used to code html and css but got lazy. recently been trying to get back into front end devlopment and your tutorials are the best i've found. keep up the good work. :)

  • @jesusmanuel3697
    @jesusmanuel3697 4 года назад +12

    I've ended my relationship with the bootstrap grid(and general) since I met this

  • @jonathansias3862
    @jonathansias3862 4 года назад

    Finally... ! Best tutorial for anyone who wants to learn css grid.
    Very well explained and clearly even for those who are starting.

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

    Dude I've been struggling the last few days trying to wrap my head around the grid concept. This was a great explanation man thank you!

  • @COMMANDERFOX31
    @COMMANDERFOX31 4 года назад +16

    Thank you for these amazing videos. They solve a lot of confusions and misunderstandings for me. You are much more helpful than most of my lazy profs!

    • @DesignCourse
      @DesignCourse  4 года назад +6

      I love hearing that (the part about the lazy professors 😂)

  • @choralguardian3442
    @choralguardian3442 4 года назад +1

    Finally understand grid pretty well. I’m learning web development and none of the courses I’ve done cover the topic very well

  • @cwinter90
    @cwinter90 4 года назад +33

    I use grid template areas whenever I use grid. It makes shit super simple.

    • @AccessCode101
      @AccessCode101 4 года назад +1

      Quick question... when would you use flexbox then? For example, for a single page application, wouldn't you use flexbox instead of grid?

    • @cwinter90
      @cwinter90 4 года назад +6

      @@AccessCode101 I pretty much only use Flexbox to make containers space evenly. So pretty much I only use flexbox to justify-content: space-between. Everything else I've had to do for my job I haven't had any problems using grid. I deal with a lot of pixel perfect layouts in my job where all spacing is exact down to a few couple pixels. There really isn't much flexing going on. I just prefer to use grid as often as possible. I absolutely love grid template areas to move things around especially since it kind of gives you a visual while typing it out. Ever been to a fast food place and they have digital menus instead of paper? (In the US) Well, that's my job. Large corporations generally like everything on their screens exact and I've found grid to be the easiest way to accomplish that personally. As for a SPA I don't see how any of that differs when using React or Vue or Angular or whatever else. It all updates dynamically. All the CSS is scoped per component and you can have grids inside of grids inside of grids without any problem and with the fractions, min-content, max-content or anything else you can accomplish whatever you need with grid.

    • @cwinter90
      @cwinter90 4 года назад +1

      @@AccessCode101 For example SPA main grid for your overall website layout. Then with a section in the middle that updates inside of that section in the middle you can use grid template areas to layout all of your individual components like forms or whatever else.
      Form grid:
      grid-template-areas:
      ". title ."
      "formContent formContent formContent"
      ". . submit";
      In formContent you just spit in all your divs and each div contains inputs.
      Input grid:
      grid-template-areas:
      "label input"
      . validationCheckError";
      It kind of gives you a visual representation of how each component lays out just looking at the CSS. The validationCheckError would just have either a fixed height so there is always room for it whether or not it's needed or you could use min-content on that row's height and with an dom if statement it only takes up space if it is actively stamped to the DOM.

    • @cwinter90
      @cwinter90 4 года назад +3

      @@AccessCode101 short answer is you can nest multiple grids inside of each other. I found this that may help explain maybe? gridbyexample.com/examples/example21/

  • @Allformyequine
    @Allformyequine 4 года назад +1

    This has become my bible for grid tutorials! Thank you for rockin it !!!

  • @ashleyhoward14
    @ashleyhoward14 4 года назад +38

    Wow when I feel like I've learnt a lot about CSS, I find this. Honestly is there anything that CSS can't do?

  • @ali_murtadha
    @ali_murtadha 4 года назад

    Wow, I searched a lot and did't understand the Grid as I understood it now .. Thank you very much.

  • @tinashevakirayi4422
    @tinashevakirayi4422 4 года назад

    this is the simplest way to understand a very powerful css tool..thank you so much Gary

  • @SuperArnie
    @SuperArnie 4 года назад +2

    Row/column definition by start and end line is easier when you think of the numbers as coordinates.
    Example ruclips.net/video/YNB-JD7iPoQ/видео.htmlm49s
    You say “yum starts on line 3 ends on 4 in terms of columns and starts on line 2 ends on 3 for the rows.”
    Then you edit every 2nd number in the code.
    My suggestion:
    Just think of the grid lines as coordinates: “yum starts at 3/2 for the left upper corner and ends at 4/3 for its lower right.”
    Type the coordinates in this natural order and you get the same result without twisting your brain into knots ;-)
    That said: Great explanation especially concerning the management of each tracks dimensions Just began using grids and sponged up every RUclips video on this, topic. Yours is definitely in the top tier.

  • @prakharmathur619
    @prakharmathur619 4 года назад

    That was PERFECT!
    This helped me a lot and now I understand CSS Grid properly.
    Man I just wanna thank you for all the hard work you do for us, it's amazing!
    I recently came across your videos, and now I am a fan...I learn from you everyday.

  • @BneiAnusim
    @BneiAnusim 4 года назад

    grid-area: 3 / 2 / 4 / 3; is basically where lines converge with each other. You need to visualize this with the "Firefox grid tool" to understand it better.

  • @hongcai4617
    @hongcai4617 4 года назад

    This is the best...I watched about 4 different series of tutorials and finanlly understand how it works...

  • @mindlessgreen
    @mindlessgreen 4 года назад

    Never seen a better explanation.

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

    2.45 - three rows, not columns. Very good videos! Subscribed

  • @nabiisakhanov3522
    @nabiisakhanov3522 4 года назад

    I finally get it... Thank you so much man, your explanation is an infinite times clearer than anything else I could find

  • @StrangeIndeed
    @StrangeIndeed 4 года назад

    13:45 random fun fact - you can highlight the word the cursor is currently on by pressing Ctrl + D. Pressing Ctrl + D again highlights the next instance of the highlighted word.
    So in this situation Gary could've just pressed Ctrl + D twice and written the word 'row'. I know that it seems like knowing this doesn't save that much time, but it adds up c:

  • @eftiprwtopapadakis9310
    @eftiprwtopapadakis9310 4 года назад

    Excellent tutorial. Finally CSS Grid makes sense and its so powerful and easy for as newbies!

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

    This video was SO good! I’ve been racking my brain about a week, trying to figure out CSS Grid. Honestly, thank you! :)

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

    that really helped me, although it's a little messy. But, that's what make things real

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

    You made it simple, I was really struggling to understand grids...Thank you

  • @daishoarch8116
    @daishoarch8116 4 года назад +6

    Get a screen recorder that can transition between 2 displays. It's really annoying having to switch between programs on only one display.

  • @bree6859
    @bree6859 4 года назад

    I'm using grid currently to structure a wine review api I'm fetching. I definitely struggled with it a bit, but was able to get it to look the way I wanted it to, this video is super helpful and I wish I had it a day ago XD. At the very least, it explained it better~

  • @md.sumonbiswas2272
    @md.sumonbiswas2272 2 года назад

    Thanks a lot, simon. I had trouble a long time with this. Finally I got it from you brother

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

    Wow, didn't know that it was this simple. Excellently Explained. 10/10 would learn again.

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

    Stupendous performance 👏

  • @Beritofficial
    @Beritofficial 4 года назад

    This is my fourth video on CSS grid and it finally made sense. Thank you! :)

  • @kvncnls
    @kvncnls 4 года назад

    Thanks so much man. I literally just finished the CSS Grid course on FreeCodeCamp and your video helped me understand how these concepts are applied to a real website page.

  • @butterchoco4538
    @butterchoco4538 4 года назад +3

    This is absolutely madness !!
    Can you please make a video about animation in using css grid ??
    For instance, I wanna make wipe transition to reveal the content.

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

    Yet another amazing video!

  • @mtlfrancesca5880
    @mtlfrancesca5880 4 года назад

    i was on the struggle train with this, for real, but now i get it!! thank you!!!!! Ive subscribed.

  • @rengoku81xx
    @rengoku81xx 4 года назад

    Thank you soooooooo much for this. This was the most clear explanation for someone that learns visually.

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

    Great explanation! I always understood block layouts and flexbox - but grid seemed like a different ball game.

  • @Colorbowl80
    @Colorbowl80 4 года назад

    Finally got grid system...thank you

  • @TheNewton
    @TheNewton 4 года назад

    @DesignCourse 3:03 for future grid teachings may want to occasionally include an animation shifting the grid numbers from centers to starts, this seems to be a consistent pain as most have been conditioned to expect the numbers to be conceptually centered to the respective grid but it almost uintuitively starts on the edges/joints

  • @KriszX12
    @KriszX12 4 года назад

    At the point where you introducing the grid-area and telling its a bit confusing. Just think as coordinates on the grid! First corner is 3-1 the second is 4-3. You just write in 3/1/4/3 format and the computer just fills the fitting square.
    Thanks for this video, this is a very easy way to grid. My teacher at Uni showed us a very bad, barely useable, confusing method for grid. And it was looong...

  • @tonnygidraph7246
    @tonnygidraph7246 4 года назад

    Maan, you are awesome
    Never used Grid before
    But now, am implementing it on a site that should be going to production soon.
    Awesome!!

  • @darkmift
    @darkmift 4 года назад +4

    Grid nowadays are a vital skill

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

    Thank you very much. Love the visuals!

  • @linojrasmolo7161
    @linojrasmolo7161 4 года назад

    Wow. Sir, you always have an amazing tuturials. Ive been watching your videos and i learn a lot from it. Thank you.

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

    Ok bro. You make grid look much easir bcs you defined 1st the term. Then you construct it in moderate speedy mode😁 I will try this.
    I wonder if grid methode has another advantage beside it simplicity compare to other methode in designing area

  • @Vijay-ih7cv
    @Vijay-ih7cv 4 года назад

    Thanks sir, understanding grid in one solution. Really amazing

  • @dharmang
    @dharmang 4 года назад +1

    Man getting some real css grids help from youtube these days. Not that i dont like it... 👍🏻

  • @endeavor4299
    @endeavor4299 4 года назад +3

    Your content is amazing and really fun to watch! You've definitely earned my sub =)

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

    Thank you so much this course has helped me so much

  • @MyALPHAguy
    @MyALPHAguy 4 года назад

    best video on css grid ever released!

  • @carolmckay5152
    @carolmckay5152 4 года назад +25

    The order of the html elements matters VERY MUCH in regards to accessibility a11y. Please research this as you are teaching people bad habits.

    • @Edwardtonnn
      @Edwardtonnn 4 года назад +11

      Agreed. Accessibility is important and we should always use best practices. Structuring your html from a top to bottom way is best - nav > content > footer etc.

    • @goldenfish31
      @goldenfish31 4 года назад +1

      It definitely does, this website would suck accessibility wise. I mean, the header at the bottom, what? Nonetheless, this video shows the basics of grid, which can be confusing sometimes. After all the title is about CSS Grid, but yeah, a little a bit of best practices here and there wouldn't hurt. It doesn't make this video less interesting.

    • @schoolofsa
      @schoolofsa 4 года назад +3

      If you "know" this stuff why are you even watching this?

    • @carolmckay5152
      @carolmckay5152 4 года назад

      @Mario Ah, the bad old fashioned way of things - "do as I say, not as I do" *SIGH*. Do we dare hope they will manage to sort this out in 2020?

    • @carolmckay5152
      @carolmckay5152 4 года назад +1

      @@goldenfish31 Yes, useful video css wise, misleading html wise, we all have room to learn more.

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

    Hi Gary ! This video is very informative to those who want to know about how css grid works, Can u pls do another video on how to add content within the grid with grid gap column gap etc , Adding text images etc...sub grid it seems is still not supported....So flexbox properties within a Grid layout...That would be more helpful 🙏🙏

  • @salemouail627
    @salemouail627 4 года назад +4

    use mediaquery to make it responsive
    just swap places;)

  • @wandat6353
    @wandat6353 4 года назад

    This helped me a lot in working with grids, Thanks!

  • @canersanli
    @canersanli 4 года назад +2

    Great content! How to make it responsive tho?

  • @bkrsaleem8
    @bkrsaleem8 4 года назад +1

    Dude you are simply the best! greeting from Austria :D

  • @ISOnepal
    @ISOnepal 4 года назад

    U did great boss. May Pasupati Nath bless u. I am subscribing ur channel.

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

    Super Video! Ich habe für 2,00 CHF Applaus gesendet. 👏

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

    Amazing course. Thank You.

  • @nicklawrence7244
    @nicklawrence7244 4 года назад +1

    @DesignCourse First off, thanks so much for this! Definitely gonna save us all quite a bit of time and headache during layout!
    Question: would you recommend using media queries for redefining your grid at breakpoints or is there another method of wrapping/resizing that you would recommend with this particular layout method?
    Thanks again so much, keep up the exceptional work! :D

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

    Two points, refer grid area by geometry, refer grid area by area name. Thanks.

  • @StrangeIndeed
    @StrangeIndeed 4 года назад

    Maybe that's a stupid question, but why do we have to put slashes between arguments in grid-column etc? Normally, we split the arguments with space, but this specific attribute requires slashes. Why is it different?
    EDIT Okay, I've figured it out. Basically you can name grid lines e.g. 'col-start 7'. There can be a space in the name, so we can't just use space to split arguments, so we have to use something else. That's the why of the slashes

  • @danvilela
    @danvilela 4 года назад

    Bro, your channel is awesome! Got a new subscriber! Thanks for the videos

  • @darkxiao
    @darkxiao 4 года назад +4

    When defining columns/rows with the FR unit, is there a best practice or convention that says the sum of those FR units need should be even? I noticed for the columns you chose 1fr 1.2fr 1.5 fr (equals 3.7fr total instead of 4fr for example). Thanks!

    • @neutralface
      @neutralface 4 года назад +1

      The sum of 'fr' -values tells how many frs is 100%. Total of 3.7frs is no different than total of 4frs since both equal 100% of the width . So the sum of all fr's shouldn't matter, only the individual frs does (e.g. *1fr* / 3.7frs = ~27%, and *1fr* / 4frs = 25%).

  • @Digmen1
    @Digmen1 4 года назад

    Annother great video Gary thanks
    I nearly managed to be able to replicate it all.
    But I got a bit lost on the section class elements

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

    this is pure gold 👍

  • @lambo-ca
    @lambo-ca 4 года назад

    Solved a lot of my confusions.
    Thanks man

  • @geoffmahugu8983
    @geoffmahugu8983 4 года назад

    This will save me a lot of development time, thanks 👍🏾

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

    Solid video! Helped me out a ton!

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

    This was really helpful, thanks!

  • @souflikar6702
    @souflikar6702 4 года назад

    Great tutorial, love the explicit example!

  • @felipewwa
    @felipewwa 4 года назад +4

    Can I use this type of grid as a template in Adobe Xd or another software without knowledge of programming? Do exist any other websites grids?

  • @satenikmnatsakanyan9567
    @satenikmnatsakanyan9567 4 года назад

    Thanks a lot
    it's amazing
    I finally understood the GRID structure

  • @davekeehl
    @davekeehl 4 года назад

    Man... thank you so much for this awesome tutorial!

  • @I_hu85ghjo
    @I_hu85ghjo 4 года назад +1

    this was so helpful. Thank you

  • @rubentorrealba
    @rubentorrealba 4 года назад

    Excellent, clear and direct. Question: why didn't you use the BEM Methodology and SASS?

    • @Jake-xs4mx
      @Jake-xs4mx 4 года назад

      Unnecessary for such a small project.

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

    Thank you very much, it really helped me a lot! 🎉

  • @TheeMelloMan
    @TheeMelloMan 4 года назад

    Thanks for telling me about firefox

  • @Anderzon1994
    @Anderzon1994 4 года назад

    Dude! You are amazing at explaining. Thanks a lot

  • @sonoftroy8572
    @sonoftroy8572 4 года назад +1

    The way I use css Grid, I only use it for small adjustments for positioning and alignment , if your markup is solid you won’t have to bloat the css file with all the grids rules

    • @onebacon_
      @onebacon_ 4 года назад +1

      Bruh u cant really get vertical alignment without grid and without "misusing" other functions. Css grid makes the mark-up way Cleaner and easy to read

    • @sonoftroy8572
      @sonoftroy8572 4 года назад

      oneBACON, yes you are absolutely right ! And I only use css grid for vertical alignment and horizontal alignment, use case would be a navigational bar or aligning cards in a row for the exact lvl of positioning

  • @dubble.
    @dubble. 2 года назад +1

    So, with this, how would you proceed to make the layout responsive? I imagine you could use media queries to line them up in a single column, but is there any other way?

  • @VicRibeiro777
    @VicRibeiro777 4 года назад

    Your'e a boss Gary, thank you for all the work and help. Much appreciated!

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

    super amazing tutorial

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

    When I used other method than GRID I felt like borracho , now I am like Macho! thanks

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

    Fantastic Video! Thank you!

  • @stevenluker793
    @stevenluker793 4 года назад

    Great stuff. Great job explaining. I have used grid-template-areas ever since learning CSS Grid. It's quicker. It's more visual if I see the areas all named and laid out in text format. And I am less likely to make as many mistakes.
    Could you do a video on doing a web page using CSS Grid for layout AND a framework like Bootstrap, Materialize, Bulma, etc. for styling elements (buttons, etc.)
    ASP.NET Core uses bootstrap out of the box. I think doing layouts would be much nicer (quicker, cleaner markup, easier to work with, easier to change). It would be easier to switch frameworks if one didn't have to think about layout too.

  • @BarunKharel
    @BarunKharel 4 года назад +10

    The opening music way too long. It should have stopped right after the ad.
    Anyway, nice content. I have not used grid till now. This video makes me wanna use grid in my next project.

  • @sanjindervisevic5243
    @sanjindervisevic5243 4 года назад +1

    This is so good. Thank you.

  • @jackvidaldigital
    @jackvidaldigital 4 года назад

    This is awesome! Thanks for your amazing videos!

  • @snowman_web_design_development
    @snowman_web_design_development 4 года назад

    Excellent job!

  • @TuneAddikt
    @TuneAddikt 4 года назад

    Great for modern browsers. If you're looking to use this in a web application though you'll need quite a lot of prefixing for the old dogs like IE11. Great explanation though.

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

      People are still using INTERNET EXPLORER?! REALLY?!