CSS Grid Tutorial #7 - Create a 12-Column Grid

Поділитися
Вставка
  • Опубліковано 9 лют 2025
  • Hey gang, in this CSS grid tutorial, I'll show you how we can create a 12-column grid using the CSS grid properties I've shown you so far. I'll also show you how to create a grid overlay so you can visualize the grid on the page.
    ----- COURSE LINKS:
    Atom editor - atom.io/a
    GitHub Repo - github.com/iam...
    ---------------------------------------------------------------------------------------------
    Other tutorials:
    ----- HTML FOR BEGINNERS:
    • HTML Tutorial for Begi...
    ----- CSS FOR BEGINNERS:
    • CSS Tutorials For Begi...
    ----- NODE.JS TUTORIALS
    • Node JS Tutorial for B...
    ----- SUBSCRIBE TO CHANNEL - / @netninja
    ============== The Net Ninja =====================
    For more front-end development tutorials & to black-belt your coding skills, head over to - / @netninja or thenetninja.co.uk
    ================== Social Links ==================
    Twitter - @TheNetNinja - / thenetninjauk

КОМЕНТАРІ • 122

  • @arminbro.
    @arminbro. 7 років тому +84

    I just want to point out to everyone that the latest version of Firefox (57) and Chrome (63) both now support highlighting and inspecting the predefined grid system within the inspector console. This will help move elements around your grid system very easily.

  • @LouisYungling
    @LouisYungling 5 років тому +16

    Stunning! Thank you for your generosity in showing us how to do this...and to create a grid overlay with check button! AMAZING! Thank you.

    • @NetNinja
      @NetNinja  5 років тому +3

      Thanks so much Louis! Glad you are liking the course!

    • @anthonynwanyanwu4329
      @anthonynwanyanwu4329 3 роки тому

      Thank you so much the course is pretty cool I really like it and what browser is this please?

  • @DIEZ919191
    @DIEZ919191 5 років тому +1

    checkbox fro showing/hiding grid is freaking coolest trick I have ever seen!!!! WOW WOW WOW !!!! TNAKS!!!!

  • @oswaldomendoza268
    @oswaldomendoza268 7 років тому +9

    The checkbox to toggle the grid on and off trick was really helpful when comparing my static layout to the HTML. Great job on these videos!

  • @meghaaggarwal8508
    @meghaaggarwal8508 4 роки тому +1

    I'm super proud of you to explain it so well and in depth ! Well done Shaun !

  • @janenic8999
    @janenic8999 6 років тому +49

    Net Ninja : makes sense ?!!!??
    Me : hmmm(nodding)
    Net Ninja : cool !!!

  • @lincolnmutwiri3481
    @lincolnmutwiri3481 Рік тому +1

    Here 5+ years later. The tutorial I was definetly looking for. Thanks

    • @NetNinja
      @NetNinja  Рік тому +1

      Awesome, hope it's helpful :)

    • @jumaelahmed9995
      @jumaelahmed9995 7 місяців тому

      Same, watching whole tutorial at 2024. Excellent content.

  • @kamaludinakbar4554
    @kamaludinakbar4554 5 років тому +11

    the best tutorials on youtube

  • @nejedly12
    @nejedly12 6 років тому +2

    Absolutely amazing tutorials. Never seen better explained this grid system!

  • @mohamedibrahemsaad573
    @mohamedibrahemsaad573 Рік тому

    you don't know how much I love your channel. thanks

    • @NetNinja
      @NetNinja  Рік тому

      Glad you enjoy it! :) thanks Mohamed

  • @mikidigital9430
    @mikidigital9430 7 років тому +1

    Hey Thank you for the tutorial. Exactly what I was looking for! To everyone confused. You can do a grid that is two columns or what ever you want. this is the most flexible way to make a grid.
    Only think I would add is I follow the 1200px.com grid. So what I do is width 1200px, 15 columns, 20px, 10px margin left and right. I also set up my grids in Photoshop the same way using GuideGuide extension. This makes it really easy to think about how I will code it while im brainstorming and designing the UI.

  • @codecrayon9120
    @codecrayon9120 5 років тому +1

    Hey Shaun. You outdid yourself in this tutorial buddy. Lots of love from India. 💙

  • @wilhelmkahn2267
    @wilhelmkahn2267 7 років тому +1

    Very cool Shaun. Am enjoying a good feeling of success as I go along. You know a lot - and I'm grateful for you for sharing your knowledge. Thanks.

  • @fullstackprojects5615
    @fullstackprojects5615 Рік тому

    The grid lines trick is pretty cool. Nice to see one real example of css positioning accidentally :)

  • @christian_life
    @christian_life 7 років тому

    Thanks Shaun, you have the best front-end tutorials in UA-cam : )

  • @mariansand9663
    @mariansand9663 7 років тому +10

    Thank you very much. Very helpful!
    Suggestions for future videos: a) PWA, b) PWA + Vue.js, c) PWA + AMP

  • @Shakeel714
    @Shakeel714 4 роки тому

    Thanks Shaun, I am learning a lot from your tutorial series

  • @JatinChhabra
    @JatinChhabra 4 роки тому

    I forgot to add diaplay:none; in the grid and for the past hour was thinking that what I did wrong, as the checkbox isn't working. Great tutorial man...

  • @scarysnake1249
    @scarysnake1249 4 роки тому

    Thank you for give us idea of checkbox You are the best teacher

  • @EduardKaresli
    @EduardKaresli 6 років тому +4

    This video is gold! Thanks a lot!

  • @duskairable
    @duskairable 4 роки тому +5

    You can display the grid overlay with only chrome dev tools,
    > open dev tools
    > beside the "content" id element you'll see "grid".
    > press it and you can see the grid overlay on the page.

  • @narjeetsingh4713
    @narjeetsingh4713 4 роки тому

    Really fabulous technique for checking accuracy grid system --- "heads off" Sir

  • @agboemmanuella8302
    @agboemmanuella8302 Рік тому

    the best tutor out here💌💌💌💌❤❤❤❤❤❤

  • @haroldramos1567
    @haroldramos1567 6 років тому +5

    I would like to know about your learning process wow. Really good

  • @timkimdesign
    @timkimdesign 5 років тому

    Awesome Tutorial. Love the checkbox grid feature. I'll be using that a lot.

  • @lardosian
    @lardosian 6 років тому

    Great little trick at the end, mad skillz as usual.

  • @أبوعائشةالشامي-ف7ر
    @أبوعائشةالشامي-ف7ر 7 років тому +2

    Bravo ..... Clear and Clean course as usual .....just small note to subscriber : donn't use (id) attribute to handle css stylesheet . use class .. id is attribute use with javascript .... our teacher ninja used it just as example ....

    • @wilhelmkahn2267
      @wilhelmkahn2267 7 років тому +1

      Thank you for your 'small note' - I was separating the style attributes into a separate css file and relating to this from the html. You took away my headache! Willy

  • @claudiaarcand2768
    @claudiaarcand2768 3 роки тому

    Okay , thank you so much, this is perfectly explain!

  • @ellsonmds5310
    @ellsonmds5310 5 років тому

    Really awesome both you and this grid system!

  • @digiexploration530
    @digiexploration530 3 роки тому

    this is 2021 in this reality and it's so relevant!

  • @VincentSmithL
    @VincentSmithL 7 років тому

    Epic tutorial series, man. Thanks.

  • @eboubaker3722
    @eboubaker3722 4 роки тому +1

    7:08 *, chrome dev tools by default have a grid overlay, you just hover over the grid container in the elements tap and it will display an overlay.

  • @micharatajczak9769
    @micharatajczak9769 7 років тому

    Absolutely fantastic tutorial!

  • @sudiptaadak7712
    @sudiptaadak7712 4 роки тому

    I have learnt a lot from your MODERN JS course on UDEMY. All your courses are just awesome. Sir can you make a course on how to implement payment gateway system..please.

  • @alexeponon3250
    @alexeponon3250 4 роки тому

    "Give us this day our daily bread" ---- I took my today already on this video

  • @DanielOliveira-vh4ye
    @DanielOliveira-vh4ye 7 років тому

    that's amazing, thank you for sharing your knowledge

  • @maddenjunkie88
    @maddenjunkie88 7 років тому +2

    Great video as always, I would love if you did an updated React tutorial (and Redux)... one can dream though ;D Thanks for all the great work you do.

    • @NetNinja
      @NetNinja  7 років тому +5

      Hey - actually thinking of doing one of these in a couple of months. :)

  • @MvanKoeveringe
    @MvanKoeveringe 5 років тому

    You sir, are golden!

  • @melpodrougou9178
    @melpodrougou9178 Рік тому

    amazing. Very helpful

  • @bpdobson8660
    @bpdobson8660 6 років тому +2

    The overlay grid would not show up untill I changed the colour, I changed it to #F00D11. I also entered string 1-12 in the tags. Spent too long on figuring this out!!. Great tutorial though!

  • @СанжарАбдуллаев-к8м

    it's amazing bro!

  • @LankaNaveen
    @LankaNaveen 7 років тому

    Thanks man, it really helped me.

  • @ahmedalhallag3338
    @ahmedalhallag3338 6 років тому

    Brilliant, seriously brilliant :D

  • @resistancet8
    @resistancet8 7 років тому

    Thank you i learnt a lot from you.

  • @Pareshbpatel
    @Pareshbpatel 9 місяців тому

    CSS Grid (12-Column) so clearly explained. Thanks, Shaun
    {2024-04-25}

  • @milesblaq998
    @milesblaq998 5 років тому

    you are awesome man.. whoa!

  • @duxiao5121
    @duxiao5121 5 років тому

    woo,great job!!!

  • @simomed5002
    @simomed5002 7 років тому

    thank you man, learned a lot :)

  • @bobwilson3815
    @bobwilson3815 6 років тому

    Again... BRILL

  • @hiteshchoudhary3412
    @hiteshchoudhary3412 7 років тому +5

    Hi Shaun, can we expect big udemy series from you, on any subject?

  • @IlPandax
    @IlPandax Рік тому

    This tutorial is awesome, thank you! I have a question: I had some strange behaviour (I was experimenting XD) when I used "span 2" instead of "grid-row: 2 / 4" on ".main". Of course the "main" div was meant to be in row 2, so it went correctly where you had in the video, but everything else ("nav", "aside", etc.) shifted down instead of going to the left. Can you explain why that happened? Thanks anyway for your great work! :D

  • @ajefersonstiv
    @ajefersonstiv 6 років тому

    wow amazing!

  • @maryamfalahsafari8368
    @maryamfalahsafari8368 4 роки тому

    Dear Ninja,
    I am wondering whether you can suggest any resources about psudo selectors or siblings selectors like what you used here, in this tutorial. Same as :input:checked + #content #grid{...}. (y)

  • @MarosiAttis
    @MarosiAttis 6 років тому

    May I ask which Atom theme & fonts do you use? It looks really cool. This CSS Grid tutorial helped me a lot, thank you!

  • @harenhallharfoot
    @harenhallharfoot 5 років тому

    For some reason my section tag won't expand anymore rows but one no matter what number I end up putting in their. When I inspect it, it has many many tiny boxes inside of it as compared to the few tiny boxes the other sections have. I've made sure my code looks *exactly* like yours but can't seem to find what's going wrong! grid-row also doesn't change for footer, it only worked for main.

  • @eddawry
    @eddawry 6 років тому +2

    easy weasy gogogogogogo
    respect teacher (y).

  • @juliorodriguez4946
    @juliorodriguez4946 11 місяців тому

    Shaun is Shikamaru! :)🥷

  • @hakunamata_tuh
    @hakunamata_tuh 7 років тому

    hey gang! what next series would be?

  • @jauynjanbyr
    @jauynjanbyr 3 роки тому

    Omg thank you sir

  • @ellsonmds5310
    @ellsonmds5310 5 років тому

    input:checked + #content #grid{ display: grid; }
    The most difficult thing so far!

  • @MrJose1196
    @MrJose1196 4 роки тому

    Hey one question, when we define for ex. 12 column it would be also 12 rows?

  • @eljardindelcodigo8462
    @eljardindelcodigo8462 3 роки тому

    Thanks!

  • @EdgarSanchez-qg7tb
    @EdgarSanchez-qg7tb 7 років тому

    Hello there, Thank you so much for this very helpful tutorial.
    I just have a question, maybe is not a good one, but when I finished building the whole grid layout in this example, I got some white extra space all around the grid, I have been searching for an answer, but I can't find one... Is it perhaps part of the grid?

  • @souvikpal6262
    @souvikpal6262 7 років тому

    @The Net Ninja , Thanks for this awesome tutorial , But what i want is to stick the footer to the bottom of the website irrespective of the device height or browser height . So that when i have much less content the footer don't stick up with other content and look awkward. Please provide a solution using css grid . :)

  • @mahmoudsamyessawy
    @mahmoudsamyessawy 5 років тому

    thank you very much :)

  • @ugurbilgin563
    @ugurbilgin563 4 роки тому

    what is the name of your theme btw? I have dark theme but not the same one.

  • @azyt
    @azyt 4 роки тому

    can you explain the >* for direct descendants?

  • @harrywotnot3377
    @harrywotnot3377 7 років тому +4

    Sorry for being thick, but what i don't understand is, why make a 12 column grid when a 2 column grid will do? Will welcome any and all replies.

    • @NetNinja
      @NetNinja  7 років тому +16

      Hey, it's thck at all. Imagine you had 3 elements spread over 1 row on a page. You can distribute them however you like over however many columns you have. For example, 1 element could be 2 columns wide, another 4 columns and the last 6 columns. As long as they all add up to 12 it's fne. So basically, 12 columns gives you much more flexibility than 2 :).

  • @Martin958
    @Martin958 5 місяців тому

    What is content div displayed relative to, and why?

  • @mdsajaldeowan1054
    @mdsajaldeowan1054 7 років тому

    thank you very much sir .for making these 10 videos for us.
    we really neded these. specially i neded a lot.
    thanks onece again!,
    why do i need visibility sir....?

  • @steven7293
    @steven7293 7 років тому

    Will there be some kind of website example at the end of this series?

    • @NetNinja
      @NetNinja  7 років тому

      Not a website, no. But I will be doing a site build using grid in the future :)

  • @dieavila69
    @dieavila69 6 років тому

    Need help! Nothing changes after I type grid-template-columns: repeate(12, 1fr); Not sure what i'm doing wrong.
    this is what I have written.
    Using CSS Grid
    body{
    color: #fff;
    font-family: 'Nunoto Semibold';
    text-align: center;
    }
    #content{
    display:grid;
    grid-template-columns: repeat(12, 1fr);
    max-width: 960px;
    margin: 0 auto;
    }
    #content>*{
    background: #3bbced;
    padding: 30px;
    }

    Header
    Main
    Section
    Aside
    Nav
    Footer

  • @i_bench_225
    @i_bench_225 Рік тому

    Watching this in the middle of work to understand what i'm doing 😅

  • @bartolj.4502
    @bartolj.4502 7 років тому

    how safe is it to use this compatibility wise??

  • @kelvinnicephorus2130
    @kelvinnicephorus2130 6 місяців тому

    Why is my grid overlay not taking the full width of the id content

  • @tabmob.4727
    @tabmob.4727 4 роки тому

    What do we gain from this 12 columns that u created !?

  • @asiamahmoodahmed4409
    @asiamahmoodahmed4409 6 років тому +1

    Thx :)

  • @yashmore3525
    @yashmore3525 6 років тому

    which font are you using in the editor?

  • @MaksymMinenko
    @MaksymMinenko 4 роки тому

    Why not use body as a grid container?

  • @diahrongrismore1054
    @diahrongrismore1054 7 років тому

    I would have to agree with 'Thin Soldier'. A lot of time and coding would have been saved to just use Firefox. Your tutorials are very good and clearly explained. I use Firefox for coding and then I will compare in other browsers. Great job.

  • @nepalcodetv6298
    @nepalcodetv6298 6 років тому

    can you recreate bootstrap grid system all from scratch using grid & sass

  • @TheArose4u
    @TheArose4u 5 років тому

    Great series so far. A bit too fast on the delivery for those of us learning through following along tho in my opinion.

  • @x15g
    @x15g 4 роки тому

    #content > *
    {
    background : #3bbced";
    padding: 30px;
    }
    the above css code basically says apply background color of #3bbced to every child of the div with id = content. However, let's say you added p tags inside your main tag or say you added h1 tags inside your section tag (to the html code in this video). Then these p tags or h1 tags will now be grandchildren of the div with id= content. But why do they also get applied background color of #33bced if they are not children?

  • @SuCKeRPunCH187
    @SuCKeRPunCH187 6 років тому

    how do u make your grid responsive?

    • @ozcanjajovski7575
      @ozcanjajovski7575 6 років тому

      you have to set media queries, so that you page reacts when the screen is a certain amount of pixels

    • @eddawry
      @eddawry 6 років тому

      media query

  • @shubhamsagar9153
    @shubhamsagar9153 4 роки тому

    at the beginning it don't look like 12 columns grid, why is that?

  • @andriikozubenko
    @andriikozubenko 7 років тому

    Thank you for this lesson. Please help, how to make footer all time in the bottom of the page with css-grid?

    • @NetNinja
      @NetNinja  7 років тому

      For this, you'll need to use a positional css property too - position: fixed. Then a bottom property of 0. This will set whatever element you give those properties to be fixed at the bottom of the page.

    • @andriikozubenko
      @andriikozubenko 7 років тому

      and here is not important columns and rows?

  • @yato94
    @yato94 3 роки тому

    why would we create DIV and style it, cannot we simply style whole BODY? it can work as being grid and all other, isn't it pointless another container?

  • @slashhashdash
    @slashhashdash 4 роки тому

    There are no files in the repo

    • @NetNinja
      @NetNinja  4 роки тому

      Hey - you just have to select the correct branch for each lesson (top left, drop down on the repo) :)

  • @namelastname4077
    @namelastname4077 5 років тому

    that would have been great - if it worked

  • @seyolas3588
    @seyolas3588 3 роки тому

    holly shit

  • @imperial-x9899
    @imperial-x9899 3 роки тому

    too hard Im droping from CS course

  • @myztazynizta
    @myztazynizta 7 років тому +7

    As long as Firefox has a proper grid inspector and Chrome does not I can't take a grid tutorial seriously if it isn't using Firefox. The last 10 minutes of this video is a waste of time compared to showing the great grid inspector in Firefox or at least the work in progress Chrome add-on that tries to do the same thing.

    • @mariansand9663
      @mariansand9663 7 років тому +17

      You quite rightly point out that the grid inspector in Firefox is great. Nevertheless, I don't think the last 10 minutes are wasted. On the contrary, I find it quite interesting to see what else is possible with the CSS grid.

    • @davidlavergne8655
      @davidlavergne8655 7 років тому +1

      Couldn't agree more. Too bad it seems nobody knows about it.

    • @sechmascm
      @sechmascm 7 років тому

      what if you're a Mac user?

    • @MrKentiba
      @MrKentiba 7 років тому +7

      can you just appreciate that he is doing all these amazing tutorials for free ?
      He never force you to watch the last 10 min + i dont think it was waste of time to know how you can make a grid inspector by yourself .

    • @imperialguardsman3154
      @imperialguardsman3154 6 років тому +2

      If you you dont like something that someone does very good (like Net Ninja and many others) for FREE, please dont brag about it.
      Instead you can brag to people that you payed for and you didnt get what they offered.
      Thanks!

  • @sairajdas6692
    @sairajdas6692 5 років тому

    Amazing!

  • @edwassermann8368
    @edwassermann8368 2 роки тому

    Amazing!!!