A complete beginner's guide to CSS Grid layout 👇🏻

Thread🧵

Grid is used for making complex web design layouts more easily as it's not so hard to master

Using Flex you can make only 1D layout but Grid gives you full power of creating 2D layout

Let's start

{ 2 / 21 }
First things first, start with giving the display property "grid" to the container element or parent element

{ 3 / 21 }
Nothing will change after adding display: flex; in the parent container becuase we need to define the width of columns. In order to set that columns width we have gird-template-columns property

{ 4 / 21 }
Let's start with defining the width of our columns.

For example, let's say I need two columns of width 60% and 40% respectively

grid-template-columns: 60% 40%;

{ 5 / 21 }
Ahh!! My grid items looks ugly as there is no spacing between them.
Here "grid-gap" property comes into play. For example I need 10px spacing along column and row

grid-gap: 10px;

{ 6 / 21 }
Similary we have grid-template-rows.

It is used to define the number of rows and height of rows.

grid-template-rows: 200px 400px;

{ 7 / 21 }
As you can see there is a lot of repeated code in
grid-template-columns: 200px 200px 200px 200px 200px;

Instead of this we can use repeat function 👇🏻

grid-template-columns: repeat(5, 200px);

{ 8 / 21 }
You might run into some responsiveness issues if you pass pixel unit or percentage in your grid-template-columns

In order to prevent this, it is recommended to use fraction values

For example 👇🏻

{ 9 / 21 }
You can use repeat function for fr as well

repeat(2, 1fr 2fr);

It wil repeat 1fr 2fr two times.

{ 10 / 21 }
Alright moving forward, you can set he height of grid element using grid-auto-rows

For ex, grid-auto-rows: 200px;

{ 11 / 21 }
Though there is a problem. By doing this, we are setting the fixed height so content inside items can be overflow.

For example 👇🏻

{ 12 / 21 }
In order to prevent this kind of issues we have minmax function

grid-auto-rows: minmax(200px, auto);

It's pretty intuitive that the height of gird items will be 200px minimun and "auto" maximun(according to content)

{ 13 / 21 }
From 14 to 21

https://t.co/QcX5188vjp

More from Pratham 👨‍💻🚀

5 great gradient background sites for every web developer and designer 🎨

🧵👇🏻


1️⃣ uiGradients

- A handpicked collection of beautiful color gradients for designers and developers.

🔗
https://t.co/EainhiePop


2️⃣ Eggradient

- Ready to use gradient background colors. ✓ Cool Gradients are prepared according to the latest design trends

🔗 https://t.co/F0uYVsZbA4


3️⃣ Mesh Gradients

- Create beautiful gradient like aurora UI in few clicks

🔗 https://t.co/MV8PT7q3Kz


4️⃣ CSS Gradient

- Create beatiful gradeint either linear or radial on different angles

🔗 https://t.co/dlCExilHAT
5 great code snippet websites for every web developer and designer

🧵👇🏻


1️⃣ 30 Seconds of Code

- Short code snippets for all your development needs

🔗
https://t.co/91L4bAxkgF


2️⃣ Free Frontend

- Free hand-picked HTML, CSS and JavaScript (jQuery, React, Vue) code examples, tutorials and articles

🔗 https://t.co/2sIAm73EdZ


3️⃣ Little Snippets

- A free collection of HTML and CSS code snippets

🔗 https://t.co/qxAyA2wA6U


4️⃣ CSS Deck

- Collection of Awesome CSS and JS Creations to help out frontend developers and designers.

🔗 https://t.co/LcZYnipvCy
Five great icons websites for every web developer and designer ⏺️

A Thread 🧵👇🏻


1️⃣ Icons 8

- Icons8 is just more than icons. You can download illustrations, vector images, music and much more

🖇️
https://t.co/inHse0QXBh


2️⃣ Icon Monstr

- Black and white themed minimal icons which looks super great. You can also cuatomize the thickness

🖇️ https://t.co/dbQrJi0IHf


3️⃣ Icon Icons

- Over one thousand free icons which you can download as icons or images

🖇️ https://t.co/h5NlH5fGGr


4️⃣ Icons finder

Filter through the world’s largest marketplace for icons with flexibility and ease. Made up by submissions from top designers around the world, and curated by the team

🖇️ https://t.co/sqiZ6H9sR7
Use these 6 AI websites to finish hours of work in minutes (take a look):

1. Sheet+

Become a spreadsheet master with Sheet+ AI-powered tools.

• Convert text to formula
• Convert formula to explanation
• Debug formulas
• Generate VBA code
• Get instant answers to any spreadsheet question

🔗
https://t.co/fWsAeKa6ko


2. DeepCode

DeepCode's AI-based code review notifies you about critical bugs in real time and shows you how to fix them.

🔗 https://t.co/dPTPq9syoy


3. Akkio

Grow your business with data-driven decisions.

Go from data to AI in 10 minutes — no code or data science skills required.

🔗 https://t.co/I29FIHDIs0


4. Autocode

Instant endpoints for webhooks, bots, and APIs.

Build and host Node.js endpoints in seconds.

Connect to your favorite APIs like Airtable, Discord, Notion, Slack, Webflow, and more.

🔗 https://t.co/uQZB0NCHJT

More from Coding

7 best GitHub repositories that can help you as a developer

Thread 🧵👇🏻

1️⃣ Awesome For Beginner

- A list of awesome beginners-friendly projects.

🔗
https://t.co/4ycLUOE52j


2️⃣ Awesome Python

- A curated list of awesome Python frameworks, libraries, software and resources.

🔗 https://t.co/6B3Ito5wML


3️⃣ 30-seconds-of-code

- Short JavaScript code snippets for all your development needs

🔗 https://t.co/zWcmMtg2xa


4️⃣ Dev Portfolio

- A lightweight, customizable single-page personal portfolio website template built with JavaScript and Sass

🔗 https://t.co/DR1fiO7TS9

You May Also Like

Fake chats claiming to be from the Irish African community are being disseminated by the far right in order to suggest that violence is imminent from #BLM supporters. This is straight out of the QAnon and Proud Boys playbook. Spread the word. Protest safely. #georgenkencho


There is co-ordination across the far right in Ireland now to stir both left and right in the hopes of creating a race war. Think critically! Fascists see the tragic killing of #georgenkencho, the grief of his community and pending investigation as a flashpoint for action.


Across Telegram, Twitter and Facebook disinformation is being peddled on the back of these tragic events. From false photographs to the tactics ofwhite supremacy, the far right is clumsily trying to drive hate against minority groups and figureheads.


Declan Ganley’s Burkean group and the incel wing of National Party (Gearóid Murphy, Mick O’Keeffe & Co.) as well as all the usuals are concerted in their efforts to demonstrate their white supremacist cred. The quiet parts are today being said out loud.


The best thing you can do is challenge disinformation and report posts where engagement isn’t appropriate. Many of these are blatantly racist posts designed to drive recruitment to NP and other Nationalist groups. By all means protest but stay safe.