- CSS Grid Templates
- 12 Column Grid (Responsive)
- 12 Column Grid (Mobile First)
- 12 Column Grid Example 2 (Responsive)
- 12 Column Grid Example 2 (Mobile First)
- 12 Column Vertical Grid (Responsive)
- 12 Column Vertical Grid (Mobile First)
- Grid Layout 1
- Grid Layout 2
- Grid Layout 3
- Grid Layout 4
- Grid Layout 5
- Grid Layout 6
- Grid Layout 7
- Grid Layout 8
- Grid Layout 9
- Grid Layout 10
- Grid Layout 11
- Grid Layout 12
- Form with Auto Placement
- Nested Grid
- Repeating Grid
- Repeating Grid with Span
- Customize Your Template
- 35 CSS Grid Examples
- Related Articles
- Author
- Links
- Made with
- About a code
- Responsive Plants Shopping UIX
- Author
- Links
- Made with
- About a code
- CSS Grid Advent Calendar
- Author
- Links
- Made with
- About a code
- Tessellations eCommerce
- Author
- Links
- Made with
- About a code
- CSS Grid Poster
- Author
- Links
- Made with
- About a code
- Fashion Blog Assymetrical Layout
- Author
- Links
- Made with
- About a code
- CSS Grid Newspaper Layout
- Author
- Links
- Made with
- About a code
- CSS Grid: Responsive Masonry Layout
- Author
- Links
- Made with
- About a code
- Left-align Last Row When Grid is Middle Aligned
- Author
- Links
- Made with
- About a code
- CSS Grid: Workout Schedule
- Author
- Links
- Made with
- About a code
- Responsive Product Grid with Layered Background
- Author
- Links
- Made with
- About a code
- Art Directed Grid with BG Image
- Author
- Links
- Made with
- About a code
- Clipped Overlapping Grid Items
- Author
- Links
- Made with
- About a code
- CSS Grid Shopping Cart
- Author
- Links
- Made with
- About a code
- Responsive Grid — News Page
- Author
- Links
- Made with
- About a code
- Grid Layout + Smooth Animation Effect
- Author
- Links
- Made with
- About a code
- Responsive Grid — News Page
- Author
- Links
- Made with
- About a code
- CSS Grid: Smashing Mag’s Contents Page
- Author
- Links
- Made with
- About a code
- CSS Grid Experiment: Keyboard Layout
- Author
- Links
- Made with
- About a code
- CSS Grid: Excel Spreadsheet
- Author
- Полное визуальное руководство/шпаргалка по CSS Grid
- Что такое CSS Grid ?
- Архитектура CSS Grid
- Схема CSS Grid
- Настройка проекта
- HTML
- CSS Grid Templates
- 12 Column Grid (Responsive)
- 12 Column Grid (Mobile First)
- 12 Column Grid Example 2 (Responsive)
- 12 Column Grid Example 2 (Mobile First)
- 12 Column Vertical Grid (Responsive)
- 12 Column Vertical Grid (Mobile First)
- Grid Layout 1
- Grid Layout 2
- Grid Layout 3
- Grid Layout 4
- Grid Layout 5
- Grid Layout 6
- Grid Layout 7
- Grid Layout 8
- Grid Layout 9
- Grid Layout 10
- Grid Layout 11
- Grid Layout 12
- Form with Auto Placement
- Nested Grid
- Repeating Grid
- Repeating Grid with Span
- Customize Your Template
CSS Grid Templates
These website layout templates are built using CSS Grid Layout.
CSS grid layout allows you to create website layouts easily, by using a kind of «ASCII art» syntax. See the grid tutorial to learn how it works. The following templates all use CSS grid layout.
12 Column Grid (Responsive)
12 Column Grid (Mobile First)
12 Column Grid Example 2 (Responsive)
12 Column Grid Example 2 (Mobile First)
12 Column Vertical Grid (Responsive)
12 Column Vertical Grid (Mobile First)
Grid Layout 1
Grid Layout 2
Grid Layout 3
Grid Layout 4
Grid Layout 5
Grid Layout 6
Grid Layout 7
Grid Layout 8
Grid Layout 9
Grid Layout 10
Grid Layout 11
Grid Layout 12
Form with Auto Placement
Automatically places each form element into the grid. The grid automatically updates as you add or remove form elements. Try it!
Nested Grid
Grid items can become grids themselves, simply by having display: grid applied to them.
Repeating Grid
Uses the repeat() notation to reduce code.
Repeating Grid with Span
Uses the repeat() notation, and some grid areas span multiple cells.
Check browser support before going live with these templates. Most major browsers have only just started supporting CSS grid as of March 2017.
Note that the templates on this page contain embedded style sheets. It is best to transfer these styles to an external style sheet if you plan to use the same styles across multiple pages (for example, a whole website).
Customize Your Template
Here are a few ways you can modify your HTML template.
- Add some free graphics to your template.
- Modify your template or simply add content with these HTML codes. Simply copy/paste them into your template.
- Check out these HTML examples for more ideas. You can copy and paste these too.
- Browse this list of JavaScript examples to add interactivity to your website. Again, you can copy and paste the code.
- Learn HTML with this HTML tutorial.
- Learn how to modify your template styles with this CSS tutorial.
- Learn how to add interactivity to your template with this JavaScript tutorial.
- Check out our other tutorials by visiting our homepage.
35 CSS Grid Examples
Collection of free CSS Grid code examples. Update of January 2020 collection. 16 new items.
Related Articles
- Bootstrap Grid Examples
- CSS Flexbox Examples
Author
Links
Made with
About a code
Responsive Plants Shopping UIX
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid Advent Calendar
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Tessellations eCommerce
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid Poster
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Fashion Blog Assymetrical Layout
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid Newspaper Layout
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid: Responsive Masonry Layout
Super cool image grid layout with CSS Grid. It’s fully responsive, source order independent and very easy to code.
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Left-align Last Row When Grid is Middle Aligned
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid: Workout Schedule
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Responsive Product Grid with Layered Background
Responsive product layout using CSS Grid and SVG background images.
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Art Directed Grid with BG Image
This art-directed grid uses a background image inside a CSS Grid container. Makes a cool effect that can bring in some color and highlight parts of the image you want users to focus on.
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Clipped Overlapping Grid Items
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid Shopping Cart
Playing around with CSS grid and how it could work in a shopping cart page.
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Responsive Grid — News Page
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Grid Layout + Smooth Animation Effect
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
Responsive Grid — News Page
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid: Smashing Mag’s Contents Page
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid Experiment: Keyboard Layout
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Links
Made with
About a code
CSS Grid: Excel Spreadsheet
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari
Author
Полное визуальное руководство/шпаргалка по CSS Grid
Сегодня мы с вами рассмотрим свойства CSS Grid (далее также — Грид), позволяющие создавать адаптивные или отзывчивые макеты веб-страниц. Я постараюсь кратко, но полно объяснить, как работает каждое свойство.
Что такое CSS Grid ?
Грид — это макет для сайта (его схема, проект).
Грид-модель позволяет размещать контент сайта (располагать его определенным образом, позиционировать). Она позволяет создавать структуры, необходимые для обеспечения отзывчивости сайтов на различных устройствах. Это означает, что сайт будет одинаково хорошо смотреться на компьютере, телефоне и планшете.
Вот простой пример макета сайта, созданного с помощью Грида.
Архитектура CSS Grid
Как же Грид работает? Элементы Грида (grid items) располагаются вдоль главной или основной (main) и поперечной (cross) оси (axis). При помощи различных свойств мы можем манипулировать элементами для создания макетов.
Помимо прочего, у нас имеется возможность объединять строки и колонки подобно тому, как мы это делаем в Excel , что предоставляет нам большую гибкость, чем Флекс ( Flexbox ).
К слову, если вас интересует Флекс, вот соответствующая статья.
Схема CSS Grid
Схема содержит все возможные свойства, предоставляемые Гридом. Эти свойства делятся на:
Обратите внимание: красным цветом отмечены сокращения для свойств:
К концу настоящей статьи у вас будет полное понимание того, как работает каждое из них.
Настройка проекта
Для данного проекта требуются начальные знания HTML , CSS и умение работать с VSCode (или другим редактором по вашему вкусу). Делаем следующее:
- Создаем директорию для проекта, например, Project1 и открываем ее в редакторе ( cd Project1 , code . )
- Создаем файлы index.html и style.css
- Устанавливаем в VSCode сервер для разработки ( Live Server , расширение) и запускаем его
Или вы можете просто открыть Codepen (или любую другую песочницу) и начать писать код.
Все готово, можно приступать к делу.
HTML
Создаем 3 контейнера внутри body :
CSS Grid Templates
These website layout templates are built using CSS Grid Layout.
CSS grid layout allows you to create website layouts easily, by using a kind of «ASCII art» syntax. See the grid tutorial to learn how it works. The following templates all use CSS grid layout.
12 Column Grid (Responsive)
12 Column Grid (Mobile First)
12 Column Grid Example 2 (Responsive)
12 Column Grid Example 2 (Mobile First)
12 Column Vertical Grid (Responsive)
12 Column Vertical Grid (Mobile First)
Grid Layout 1
Grid Layout 2
Grid Layout 3
Grid Layout 4
Grid Layout 5
Grid Layout 6
Grid Layout 7
Grid Layout 8
Grid Layout 9
Grid Layout 10
Grid Layout 11
Grid Layout 12
Form with Auto Placement
Automatically places each form element into the grid. The grid automatically updates as you add or remove form elements. Try it!
Nested Grid
Grid items can become grids themselves, simply by having display: grid applied to them.
Repeating Grid
Uses the repeat() notation to reduce code.
Repeating Grid with Span
Uses the repeat() notation, and some grid areas span multiple cells.
Check browser support before going live with these templates. Most major browsers have only just started supporting CSS grid as of March 2017.
Note that the templates on this page contain embedded style sheets. It is best to transfer these styles to an external style sheet if you plan to use the same styles across multiple pages (for example, a whole website).
Customize Your Template
Here are a few ways you can modify your HTML template.
- Add some free graphics to your template.
- Modify your template or simply add content with these HTML codes. Simply copy/paste them into your template.
- Check out these HTML examples for more ideas. You can copy and paste these too.
- Browse this list of JavaScript examples to add interactivity to your website. Again, you can copy and paste the code.
- Learn HTML with this HTML tutorial.
- Learn how to modify your template styles with this CSS tutorial.
- Learn how to add interactivity to your template with this JavaScript tutorial.
- Check out our other tutorials by visiting our homepage.