Day #4 of learning in public
Grid sections

Day #4 of learning in public

Today I learned about grids in #css. I made my own custom grid on my project.

What is grid?

css grid


CSS Grid Layout, a powerful and flexible layout system that allows you to create two-dimensional grid structures for arranging and positioning elements in a web page. CSS Grid is designed to simplify complex layout tasks and provides fine-grained control over the placement of content within a grid.

Here's a brief summary of the grid property in CSS:

  • Grid Container: The element with display: grid; becomes a grid container, defining the context for the grid layout.
  • Grid Items: Child elements of the grid container are referred to as grid items and can be placed anywhere within the grid.
  • Grid Rows and Columns: You can define the number of rows and columns in the grid using properties like grid-template-rows and grid-template-columns.
  • Grid Gaps: You can specify the gap (space) between rows and columns using properties like grid-row-gap and grid-column-gap.
  • Grid Placement: You can control the placement of grid items using properties like grid-row and grid-column, allowing you to position items in specific cells or spanning multiple cells.
  • Responsive Layouts: CSS Grid allows for responsive design by using media queries and defining different grid structures for various screen sizes.
  • Auto Placement: You can use the grid-auto-flow property to control how additional items are placed within the grid.
  • Alignment: CSS Grid provides alignment properties like justify-items, align-items, justify-content, and align-content to fine-tune the alignment of grid items.

.grid-container {
  display: grid;
  grid-template-rows: 1fr 2fr;Two rows with relative sizes
  grid-template-columns: 1fr 2fr 1fr; Three columns with relative sizes
}
.grid-container {
  grid-row-gap: 10px;
  grid-column-gap: 20px;
  /* OR shorthand */
  grid-gap: 10px 20px;
}
        


Nice!? You might be interested in joining our platform, TheWide - a brand new social network for coders & developers. Connect, collaborate, exchange ideas, and *share code directly to your feed* ?? Also, it's totally FREE ??, so come check us out at https://thewide.com/ ?

回复

要查看或添加评论,请登录

Pratik Kumar Jaiswal的更多文章

  • Day 25 Learning In Public

    Day 25 Learning In Public

    Day 25: Explored the power of React Query and utilized Tanstack to optimize data fetching and state management in React…

    1 条评论
  • Day 23 :Learning In Public

    Day 23 :Learning In Public

    "Unlocking React's Potential: A Deep Dive into the Callback Hook" Mastered the Callback Hook in React today, a powerful…

    1 条评论
  • Day #17 of Learning in Public

    Day #17 of Learning in Public

    In today's project, I unveiled "Marvel Assemble," a dynamic carousel webpage born from HTML, CSS, and JavaScript…

  • DAY #16 of Learning In Public

    DAY #16 of Learning In Public

    Today's creative Endeavor resulted in : A tranquil meditation page crafted with HTML, CSS, and JavaScript. The soothing…

  • DAY #14 OF LEARNING IN PUBLIC

    DAY #14 OF LEARNING IN PUBLIC

    Affordigo Day 14: Explored the CSS property, a pivotal tool in creating versatile, multi-line layouts within flex…

  • Day #13 of Learning In Public

    Day #13 of Learning In Public

    Day 13: Today's exploration led me to the intriguing realm of the CSS property. Discovering how to modify and animate…

    2 条评论
  • Day 12: Today, I delved into the fundamentals of setting up a project.

    Day 12: Today, I delved into the fundamentals of setting up a project.

    Learning the essentials of project structuring, media queries, and responsive design principles has been pivotal. It's…

    2 条评论
  • Save your preloader spinner

    Save your preloader spinner

    codepen link provided below Loader Spinner Follow me Pratik Kumar Jaiswal for more!!! ?? ??#html #css #javascript…

  • Day #10 of Learning In Public

    Day #10 of Learning In Public

    Day 10: Diving into the world of Sass, I harnessed the versatility of , , and properties to create dynamic layouts…

  • Day #9 of Learning in Public.

    Day #9 of Learning in Public.

    A productive day exploring the power of in CSS for layering elements and mastering linear hover effects. These skills…

    1 条评论

社区洞察

其他会员也浏览了