CSS Grid (Part 2)

Defining Grid Areas

The grid-template-areas property allows you to name specific areas of your grid and place items accordingly. This method makes you grid layout more readable and easier to manage.

  • Setting Up Grid Areas:

In this example, we’ve defined a layout with areas for a header, sidebar, main cotent, and footer.

Tutorials dojo strip
CSS




Spanning Rows and Columns

Sometimes, you need elements to span multiple rows or columns. You can achieve this using the grid-column and grid-row properties.

  • Spanning Multiple Rows/Columns:
CSS




CSS Grid (Part 2 ) Example Code

CSS




CSS Labs

Tutorials dojo strip