In the lesson on Grid module terminology, we showed you the Hexlet blog and an example of the grid it uses. You may have noticed that in addition to the strips themselves that the content lines up directly alongside, this grid used indents between the bars. They were highlighted in orange in the image.
So what are they for? Often, all of our content inside the cells takes up the full width. In this case, column indentation is a substitute for the margin property, but with one essential condition: the Grid module automatically indents only where necessary. This means that there's no need to override unnecessary margin in the first or last strips of the grid during development.
Separately, it is worth mentioning that these indents do not work - they will be added to the width of the stripes within which the element is located. There will be no indentation inside the element itself.
Let's move on from theory to practice. Let's take one of the examples from the previous lessons. It shows a typical two-column layout, which is often found in development. For convenience, in addition to defining Grid-areas, we'll set the width of each column as 100 pixels in this lesson:
Pay special attention to how the grid-template-areas, grid-template-columns/grid-template-rows properties work together. As you can see, they're not a substitute for each other, they actually work well together.
This example shows a layout consisting of 6 columns. At the moment, there's no indentation between the sidebar and the main content. This usually has a bad effect on the readability of the information in the layout, as the texts in the two different elements start to stick together.
To solve the problem with creating indents between Grid-bars there are 2 properties: grid-column-gap and grid-row-gap. As you can guess from the name, the first property is responsible for the indent between columns, and the second property is the indent between rows. The property's value is any unit available in CSS. Pixels, percentages, or any other unit of measurement.
Create an indentation in our two-column layouts, measuring 30 pixels between columns. To do this, you need to set the container to the necessary value.
If you look at the resulting layout with Chrome DevTools, we get the following:
Note the indentation between columns and the fact that, despite them being there, no indentation has appeared within the elements. The indentations have become part of our elements. And the required indentation of 30 pixels has appeared between the sidebar and main content.
As it happens, the grid-column-gap and grid-row-gap properties are slowly being removed from the standard. The CSS specification now allows you to set exactly the same indentation in the Flex module to get away from the current problems with negative indentation when creating layouts. Therefore, a decision was taken to make the rules for both Flex and Grid the same. The new versions of the properties got rid of the grid-* and are now simply called column-gap and row-gap.
As of mid-2020, almost all browsers support these properties. The exceptions are older browsers, pre-2018 versions, and Safari, which only knows how to work with grid-column-gap and grid-row-gap. Keep a close eye on this point when you're developing pages. You can always keep track of this information using Can I use, which is an indispensable assistant for any layout designer.
For convenience, the developers of CSS Grid Layout have added a shortened grid-gap property (or simply gap) to allow you to specify the indents between columns and rows in one single property. The grid-gap property can take two values:
- Indent between rows.
- Indent between columns.
If you specify only one value in the property, the browser will set this indent for both columns and rows.
Strip positioning
There are two properties in CSS Grid Layout that allow you to automatically align the strips inside the container. These are the justify-content and align-content properties. Does that remind you of anything? If you've taken the Flex course, you'll have recognized these properties. Now you can see how closely the CSS Flexible Box Layout and CSS Grid Layout modules are related. When you develop with these two modules, you'll often use the same properties, which, as you can easily guess, also have the same values. Let's look at them. As an example, let's take three strips, each with a different color, to see the difference more clearly. The container itself will be painted gray so you can see its width.
justify-content
The justify-content property allows you to align the Grid-bars horizontally. I.e., the columns are aligned with the container. As in the Flex module, the justify-content property can take the following values:
start — is the normal behavior of elements within a container. All of our columns start from the left edge and run horizontally one after another. Examples in this case will be superfluous.
end — With this value, all elements inside the container will be shifted to the right border.
center — As the name implies, all elements inside the container will be centered inside the container.
stretch — This property is the default value when the columns are not set to a fixed width. To visualize this, let's change the example a bit. Let's make columns with an automatic width. Blocks with a dark border are elements in a container. Each element is 40 pixels wide and 40 pixels tall.
Be sure to try changing the justify-content values in this example to see how the elements behave when you use the values you already know.
space-around. Here everything works exactly the same way as in Flex. The space-around value will make equal indentation between columns, and half that distance along the edges of the container.
space-evenly. The value works the same way as space-around with one exception; the indents on the edges of the container are set to full width instead of half the distance between elements.
space-between. With this value, all elements have the same distance between them. There is no indentation from the edges. The first and last element are pressed against the edges of the container. If there are only two of these elements, they will be located on the edges of the container.
align-content
The align-content property is very similar in behavior to the justify-content property. The only difference is the direction of alignment. justify-content aligns the columns inside the container, and align-content aligns the rows inside the container. For demonstration purposes, we'll use an example from codepen, which we'll use to show all the values the property takes.
<!DOCTYPE html>
<html class="h-100" data-bs-theme="light" data-mantine-color-scheme="light" lang="en" prefix="og: https://ogp.me/ns#">
<head>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<link crossorigin="true" href="https://cdn.hexlet.io" rel="preconnect">
<meta content="aa2vrdtq64dub8knuf83lwywit311w" name="facebook-domain-verification">
<link href="/favicon.ico" rel="icon" sizes="any">
<link href="/favicon.svg" rel="icon" type="image/svg+xml">
<link href="/apple-touch-icon.png" rel="apple-touch-icon">
<link href="/manifest.webmanifest" rel="manifest">
<script>
//<![CDATA[
window.gon={};gon.ym_counter="25559621";gon.is_bot=true;gon.applications={};gon.current_user={"id":null,"last_viewed_notification_id":null,"email":null,"state":null,"first_name":"","last_name":"","current_program":null,"current_team":null,"full_name":"","guest":true,"can_use_paid_features":false,"is_hexlet_employee":false,"sanitized_phone_number":"","can_subscribe":true,"can_renew_education":false};gon.token="75vkloGcXt8fsXLZCbyfkrllw_8MRvk5nJulpIYFJwK8XYmgoPdlP3i7jTG7IqhTtc9NpMBY4zU-Hm-3y9n42Q";gon.locale="en";gon.language="en";gon.theme="light";gon.rails_env="production";gon.mobile=false;gon.google={"analytics_key":"UA-1360700-51","optimize_key":"GTM-5QDVFPF"};gon.captcha={"google_v3_site_key":"6LenGbgZAAAAAM7HbrDbn5JlizCSzPcS767c9vaY","yandex_site_key":"ysc1_Vyob5ZPPUdPBsu0ykt8bVFdzsfpoVjQChLGl2b4g19647a89","verification_failed":null};gon.social_signin=false;gon.typoreporter_google_form_id="1FAIpQLScNwxM8rjQRRWqW5G6dn6-0NvLUblFemy7EvA9VsJ7Ov5wXqA";
//]]>
</script>
<meta charset="utf-8">
<title>Working with a grid | CSS: Layout on the Grid</title>
<meta name="description" content="Working with a grid / CSS: Layout on the Grid: Learning about the indentation between strips and the alignment of the grid strips">
<link rel="canonical" href="https://hexlet.io/courses/css-grid/lessons/grid-property/theory_unit">
<meta name="robots" content="noarchive">
<meta property="og:title" content="Working with a grid">
<meta property="og:title" content="CSS: Layout on the Grid">
<meta property="og:description" content="Working with a grid / CSS: Layout on the Grid: Learning about the indentation between strips and the alignment of the grid strips">
<meta property="og:url" content="https://hexlet.io/courses/css-grid/lessons/grid-property/theory_unit">
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="eO5yMuVvN81AIRY0Eauc8Vsc4fH7wKrD13htDCSFE5srKB8ExAQMLScr6dyjNaswV7ZvqjfesM91_acfaVnMQA" />
<script src="/vite/assets/inertia-CgrHVkgd.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/preload-helper-C1cfMHAs.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/init-0bhwJkNI.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ahoy-BXKrsWjp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/analytics-Du9ljYPK.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ErrorFallbackBlock-V3hfk_CP.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/RootLayout-CUZzAr0T.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Surface-DbDKujDz.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/gon-B-jV56Ol.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/mantine-DOJkeu70.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/utils-ClTF9s_T.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-mvvEXZQ8.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/index.esm-DATLpQdV.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Modal-BhY0AP_c.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Textarea-P1s4q94S.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/exports-BsSGGK2I.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dayjs.min-Bfba02I7.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/client-CYyKzrjQ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-dom-SJZekO2j.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useTranslation-bo78L81P.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/compiler-runtime-BhqaZ6vG.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/jsx-runtime-DlXMvSuQ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-CFtMU8gd.js" as="script" crossorigin="anonymous">
<link rel="stylesheet" href="/vite/assets/application-BhDYOUva.css" />
<script src="/vite/assets/application-ZyVHkzwO.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/autocomplete-BokUl44d.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-mvvEXZQ8.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/createPopper-gQnwoPhY.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/js.cookie-CB1F2-VC.js" as="script" crossorigin="anonymous"><link rel="stylesheet" href="/vite/assets/application-BhDYOUva.css" media="screen" />
<!-- Google Tag Manager - deferred -->
<script>
// dataLayer stub сразу — пуши работают до загрузки скрипта
window.dataLayer = window.dataLayer || [];
// Сам скрипт — отложенно после load
window.addEventListener('load', function() {
setTimeout(function() {
dataLayer.push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
var j = document.createElement('script');
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=GTM-WK88TH';
document.head.appendChild(j);
}, 1500);
});
</script>
<!-- End Google Tag Manager -->
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe height="0" src="https://www.googletagmanager.com/ns.html?id=GTM-WK88TH" style="display:none;visibility:hidden" width="0"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
<header class="sticky-top bg-body">
<nav class="navbar navbar-expand-lg">
<div class="container-xxl">
<a class="navbar-brand" href="/"><img alt="Hexlet logo" height="24" src="https://hexlet.io/vite/assets/logo_en_light-FS-yL6XB.svg" width="96">
</a><button aria-controls="collapsable" aria-expanded="false" aria-label="Menu" class="navbar-toggler border-0 mb-0 mt-1" data-bs-target="#collapsable" data-bs-toggle="collapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsable">
<ul class="navbar-nav mb-lg-0 mt-lg-1">
<li class="nav-item dropdown">
<button aria-haspopup class="btn nav-link" data-bs-toggle="dropdown" type="button">
All courses
<span class="bi bi-chevron-down align-middle ms-1"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item d-flex py-2" href="/courses"><div class="fw-bold me-auto">Everything</div>
<div class="text-muted">8</div>
</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="dropdown-item">
<b>Popular categories</b>
</li>
<li>
<a class="dropdown-item py-2" href="/courses_backend-development">Backend Development
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_devops">DevOps
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_frontend-development">Frontend Development
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_testing">Testing
</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="dropdown-item">
<b>Popular courses</b>
</li>
<li>
<a class="dropdown-item py-2" href="/programs/frontend">Frontend Developer
</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<button aria-haspopup class="btn nav-link" data-bs-toggle="dropdown" type="button">
About Hexlet
<span class="bi bi-chevron-down align-middle"></span>
</button>
<ul class="dropdown-menu bg-body">
<li>
<a class="dropdown-item py-2" href="/pages/about">About company
</a></li>
<li>
<a class="dropdown-item py-2" href="/blog">Blog
</a></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/hse-research" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.results">Results</span>
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://career.hexlet.io" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.career">Career</span>
</span></li>
<li>
<a class="dropdown-item py-2" href="/testimonials">Testimonials
</a></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://t.me/hexlet_help_bot" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.support">Support</span>
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/referal-program/?promo_creative=priglasite-druzei&promo_name=referal-program&promo_position=promo_position&promo_start=010724&promo_type=link" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.referal_program">Referal Program</span>
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/certificate" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.certificates">Certificates</span>
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://hh.ru/employer/4307094" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.vacancies">Vacancies</span>
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://b2b.hexlet.io" data-target="_blank" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.teams">Teams</span>
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://hexly.ru/" data-target="_blank" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.college">College</span>
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://hexlyschool.ru/" data-target="_blank" role="button"><span class="translation_missing" title="translation missing: en.layouts.header.private_school">Private School</span>
</span></li>
</ul>
</li>
</ul>
<ul class="navbar-nav flex-lg-row align-items-lg-center gap-2 ms-auto">
<li>
<a class="nav-link" aria-label="Switch theme" href="/theme/switch?new_theme=dark"><span aria-hidden="true" class="bi bi-moon"></span>
</a></li>
<li>
<span data-target="_self" class="nav-link external-link" data-href="/u/new" role="button"><span>Sign up</span>
</span></li>
<li>
<span data-target="_self" class="nav-link external-link" data-href="https://hexlet.io/session/new" role="button"><span>Sign in</span>
</span></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="x-container-xxxl">
</div>
<main class="mb-6 min-vh-100 h-100">
<link rel="preload" as="image" href="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTIzMzUsInB1ciI6ImJsb2JfaWQifX0=--f8607de9d6d23daf38a4dc6c25bda62ecf665f95/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Hand%20coding-cuate.png"/><link rel="preload" as="image" href="/vite/assets/development-BVihs_d5.png"/><div id="app" data-page="{"component":"web/courses/lessons/theory_unit","props":{"errors":{},"locale":"en","language":"en","httpsHost":"https://hexlet.io","host":"hexlet.io","colorScheme":"light","auth":{"user":{"id":null,"last_viewed_notification_id":null,"email":null,"state":null,"first_name":"","last_name":"","current_program":null,"current_team":null,"full_name":"","guest":true,"can_use_paid_features":false,"is_hexlet_employee":false,"sanitized_phone_number":"","can_subscribe":true,"can_renew_education":false}},"cloudflareTurnstileSiteKey":"0x4AAAAAAA15KmeFXzd2H0Xo","vkIdClientId":"51586979","yandexIdClientId":null,"formAuthToken":"dmrvG1fNrDkpGeoOwVE5A9vi4bvaFzErOd5oJFklp2glrIItdqaX2U4TFeZzzw7C10hv4BYJKyebW6I3FPl4sw","topics":[],"lesson":{"exercise":{"id":2434,"slug":"css_grid_grid_property_exercise","name":null,"state":"active","kind":"exercise","language":"html","locale":"en","has_web_view":true,"has_test_view":false,"reviewable":true,"readme":"Implement a two-column website template using grids. There will be two grids in this project:\n\n* General grid for the entire template. The grid consists of 8 columns. With its help, the main blocks of the layout are built:\n * Site header\n * Carousel\n * Left sidebar\n * Main content\n\n* Grid for product cards. The grid consists of 12 equal columns. Its main feature is flexibility. All cards receive space depending on the specified class. For example, the `.col-4` class gives the element 4 columns within the grid.\n\nAll classes and markup are ready and located in the _index.html_ file\n\nWithin the main grid, the following rules apply:\n\n* Indents between columns horizontally and vertically: 20 pixels.\n* Items inside the grid have the following dimensions:\n * Site header: **8** columns.\n * Carousel: **8** columns.\n * Sidebar: **2** columns.\n * Content part: **6** columns.\n\nWithin the catalog grid, the following rules apply:\n\n* Indents between columns horizontally and vertically: 20 pixels.\n* Products have the following width:\n * Items 1, 2, 3: **4** columns.\n * Item 4: **6** columns.\n * Items 5 and 6: **3** columns each.\n * Items 7: **12** columns.\n\n## The final look of the task\n\n\n","prepared_readme":"Implement a two-column website template using grids. There will be two grids in this project:\n\n* General grid for the entire template. The grid consists of 8 columns. With its help, the main blocks of the layout are built:\n * Site header\n * Carousel\n * Left sidebar\n * Main content\n\n* Grid for product cards. The grid consists of 12 equal columns. Its main feature is flexibility. All cards receive space depending on the specified class. For example, the `.col-4` class gives the element 4 columns within the grid.\n\nAll classes and markup are ready and located in the _index.html_ file\n\nWithin the main grid, the following rules apply:\n\n* Indents between columns horizontally and vertically: 20 pixels.\n* Items inside the grid have the following dimensions:\n * Site header: **8** columns.\n * Carousel: **8** columns.\n * Sidebar: **2** columns.\n * Content part: **6** columns.\n\nWithin the catalog grid, the following rules apply:\n\n* Indents between columns horizontally and vertically: 20 pixels.\n* Products have the following width:\n * Items 1, 2, 3: **4** columns.\n * Item 4: **6** columns.\n * Items 5 and 6: **3** columns each.\n * Items 7: **12** columns.\n\n## The final look of the task\n\n\n","has_solution":true,"entity_name":"Working with a grid"},"units":[{"id":8066,"name":"theory","url":"/courses/css-grid/lessons/grid-property/theory_unit"},{"id":8430,"name":"quiz","url":"/courses/css-grid/lessons/grid-property/quiz_unit"},{"id":8379,"name":"exercise","url":"/courses/css-grid/lessons/grid-property/exercise_unit"}],"links":[],"ordered_units":[{"id":8066,"name":"theory","url":"/courses/css-grid/lessons/grid-property/theory_unit"},{"id":8430,"name":"quiz","url":"/courses/css-grid/lessons/grid-property/quiz_unit"},{"id":8379,"name":"exercise","url":"/courses/css-grid/lessons/grid-property/exercise_unit"}],"id":3601,"slug":"grid-property","state":"approved","name":"Working with a grid","course_order":500,"goal":"Learning about the indentation between strips and the alignment of the grid strips","self_study":null,"theory_video_provider":null,"theory_video_uid":null,"theory":"In the lesson on _Grid_ module terminology, we showed you the _Hexlet_ blog and an example of the grid it uses. You may have noticed that in addition to the strips themselves that the content lines up directly alongside, this grid used indents between the bars. They were highlighted in orange in the image.\n\n\n\nSo what are they for? Often, all of our content inside the cells takes up the full width. In this case, column indentation is a substitute for the _margin_ property, but with one essential condition: the _Grid_ module automatically indents only where necessary. This means that there's no need to override unnecessary _margin_ in the first or last strips of the grid during development.\n\nSeparately, it is worth mentioning that these indents do not work - they will be added to the width of the stripes within which the element is located. There will be no indentation inside the element itself.\n\nLet's move on from theory to practice. Let's take one of the examples from the previous lessons. It shows a typical two-column layout, which is often found in development. For convenience, in addition to defining _Grid-areas_, we'll set the width of each column as 100 pixels in this lesson:\n\n<iframe height=\"348\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_example\" src=\"https://codepen.io/hexlet/embed/WNKWzvo?default-tab=result&editable=true&theme-id=light\" frameborder=\"no\" loading=\"lazy\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href=\"https://codepen.io/hexlet/pen/WNKWzvo\">\n css_grid_property_example</a> by Hexlet (<a href=\"https://codepen.io/hexlet\">@hexlet</a>)\n on <a href=\"https://codepen.io\">CodePen</a>.\n</iframe>\n\nPay special attention to how the `grid-template-areas`, `grid-template-columns`/`grid-template-rows` properties work together. As you can see, they're not a substitute for each other, they actually work well together.\n\nThis example shows a layout consisting of 6 columns. At the moment, there's no indentation between the sidebar and the main content. This usually has a bad effect on the readability of the information in the layout, as the texts in the two different elements start to stick together.\n\n<iframe height=\"346\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_example_2\" src=\"https://codepen.io/hexlet/embed/yLqrKYo?default-tab=result&editable=true&theme-id=light\" frameborder=\"no\" loading=\"lazy\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href=\"https://codepen.io/hexlet/pen/yLqrKYo\">\n css_grid_property_example_2</a> by Hexlet (<a href=\"https://codepen.io/hexlet\">@hexlet</a>)\n on <a href=\"https://codepen.io\">CodePen</a>.\n</iframe>\n\nTo solve the problem with creating indents between _Grid-bars_ there are 2 properties: `grid-column-gap` and `grid-row-gap`. As you can guess from the name, the first property is responsible for the indent between columns, and the second property is the indent between rows. The property's value is any unit available in _CSS_. Pixels, percentages, or any other unit of measurement.\n\nCreate an indentation in our two-column layouts, measuring 30 pixels between columns. To do this, you need to set the _container_ to the necessary value.\n\n<iframe height=\"357\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_gap_column\" src=\"https://codepen.io/hexlet/embed/oNMOqjm?default-tab=result&editable=true&theme-id=light\" frameborder=\"no\" loading=\"lazy\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href=\"https://codepen.io/hexlet/pen/oNMOqjm\">\n css_grid_property_gap_column</a> by Hexlet (<a href=\"https://codepen.io/hexlet\">@hexlet</a>)\n on <a href=\"https://codepen.io\">CodePen</a>.\n</iframe>\n\nIf you look at the resulting layout with _Chrome DevTools_, we get the following:\n\n\n\nNote the indentation between columns and the fact that, despite them being there, no indentation has appeared within the elements. The indentations have become part of our elements. And the required indentation of 30 pixels has appeared between the sidebar and main content.\n\n---\n\nAs it happens, the `grid-column-gap` and `grid-row-gap` properties are slowly being removed from the standard. The _CSS_ specification now allows you to set exactly the same indentation in the _Flex_ module to get away from the current problems with negative indentation when creating layouts. Therefore, a decision was taken to make the rules for both _Flex_ and _Grid_ the same. The new versions of the properties got rid of the _grid-*_ and are now simply called `column-gap` and `row-gap`.\n\nAs of mid-2020, almost all browsers support these properties. The exceptions are older browsers, pre-2018 versions, and _Safari_, which only knows how to work with `grid-column-gap` and `grid-row-gap`. Keep a close eye on this point when you're developing pages. You can always keep track of this information using [Can I use](https://caniuse.com/), which is an indispensable assistant for any layout designer.\n\n---\n\nFor convenience, the developers of _CSS Grid Layout_ have added a shortened `grid-gap` property (or simply `gap`) to allow you to specify the indents between columns and rows in one single property. The `grid-gap` property can take two values:\n\n* Indent between rows.\n* Indent between columns.\n\nIf you specify only one value in the property, the browser will set this indent for both columns and rows.\n\n<iframe height=\"390\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_gap_column_2\" src=\"https://codepen.io/hexlet/embed/poZBLEr?default-tab=result&editable=true&theme-id=light\" frameborder=\"no\" loading=\"lazy\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href=\"https://codepen.io/hexlet/pen/poZBLEr\">\n css_grid_property_gap_column_2</a> by Hexlet (<a href=\"https://codepen.io/hexlet\">@hexlet</a>)\n on <a href=\"https://codepen.io\">CodePen</a>.\n</iframe>\n\n\n## Strip positioning\n\nThere are two properties in _CSS Grid Layout_ that allow you to automatically align the strips inside the container. These are the `justify-content` and `align-content` properties. Does that remind you of anything? If you've taken the _Flex_ course, you'll have recognized these properties. Now you can see how closely the _CSS Flexible Box Layout_ and _CSS Grid Layout_ modules are related. When you develop with these two modules, you'll often use the same properties, which, as you can easily guess, also have the same values. Let's look at them. As an example, let's take three strips, each with a different color, to see the difference more clearly. The container itself will be painted gray so you can see its width.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify\" src=\"https://codepen.io/hexlet/embed/ExPbPRW?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/ExPbPRW'>css_grid_property_justify</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n### justify-content\n\nThe `justify-content` property allows you to align the _Grid-bars_ horizontally. I.e., the columns are aligned with the container. As in the _Flex_ module, the `justify-content` property can take the following values:\n\n**start** — is the normal behavior of elements within a container. All of our columns start from the left edge and run horizontally one after another. Examples in this case will be superfluous.\n\n**end** — With this value, all elements inside the container will be shifted to the right border.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify_end\" src=\"https://codepen.io/hexlet/embed/gOPXPZq?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/gOPXPZq'>css_grid_property_justify_end</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n**center** — As the name implies, all elements inside the container will be centered inside the container.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify_center\" src=\"https://codepen.io/hexlet/embed/KKVyVEd?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/KKVyVEd'>css_grid_property_justify_center</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n**stretch** — This property is the default value when the columns are not set to a fixed width. To visualize this, let's change the example a bit. Let's make columns with an automatic width. Blocks with a dark border are elements in a container. Each element is 40 pixels wide and 40 pixels tall.\n\nBe sure to try changing the `justify-content` values in this example to see how the elements behave when you use the values you already know.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify_stretch\" src=\"https://codepen.io/hexlet/embed/wvMPMOL?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/wvMPMOL'>css_grid_property_justify_stretch</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n**space-around**. Here everything works exactly the same way as in _Flex_. The _space-around_ value will make equal indentation between columns, and half that distance along the edges of the container.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify_around\" src=\"https://codepen.io/hexlet/embed/zYrPqdW?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/zYrPqdW'>css_grid_property_justify_around</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n**space-evenly**. The value works the same way as _space-around_ with one exception; the indents on the edges of the container are set to full width instead of half the distance between elements.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify_evenly\" src=\"https://codepen.io/hexlet/embed/BajmKmo?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/BajmKmo'>css_grid_property_justify_evenly</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n**space-between**. With this value, all elements have the same distance between them. There is no indentation from the edges. The first and last element are pressed against the edges of the container. If there are only two of these elements, they will be located on the edges of the container.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_justify_between\" src=\"https://codepen.io/hexlet/embed/BajmKYj?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/BajmKYj'>css_grid_property_justify_between</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n\n### align-content\n\nThe `align-content` property is very similar in behavior to the `justify-content` property. The only difference is the direction of alignment. `justify-content` aligns the columns inside the container, and `align-content` aligns the rows inside the container. For demonstration purposes, we'll use an example from _codepen_, which we'll use to show all the values the property takes.\n\n<iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"css_grid_property_align_content\" src=\"https://codepen.io/hexlet/embed/bGEYpxw?height=265&theme-id=light&default-tab=css,result&editable=true\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\">\n See the Pen <a href='https://codepen.io/hexlet/pen/bGEYpxw'>css_grid_property_align_content</a> by Hexlet\n (<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.\n</iframe>\n"},"lessonMember":null,"courseMember":null,"course":{"start_lesson":{"exercise":null,"units":[{"id":8062,"name":"theory","url":"/courses/css-grid/lessons/intro/theory_unit"}],"links":[],"ordered_units":[{"id":8062,"name":"theory","url":"/courses/css-grid/lessons/intro/theory_unit"}],"id":3597,"slug":"intro","state":"approved","name":"Introduction","course_order":100,"goal":"Getting to know the Grid concept, the key points and differences from Flex","self_study":null,"theory_video_provider":null,"theory_video_uid":null,"theory":"Now you're acquainted with positioning and Flex. You might have noticed that with all the variety of tools available, it's not as easy to use these tools to create layouts directly as you'd like. By adding so many techniques, Flex has missed the most important feature — you cannot create a grid for a site quickly.\n\nWhen you want to create a good structure, you do additional nesting because Flex is essentially a one-dimensional system. We can easily manage something on either the **x-axis** or the **y-axis**. It helps to work with content but not with a page structure.\n\nFlex's creators intended to change layout standards, ridding developers of awkward positioning and endless suffering from Float. Even though it does that perfectly, there's still one main problem, what do you do with complex patterns? The number of Flex containers grew in proportion to the number of non-standard elements.\n\nHowever, managing all this got much more difficult. Without a structured web page grid all described in one place, everything is unbelievably fragile. It's liable to break faster than you can blink.\n\n**CSS Grid Layout** or just **often abbreviated to _Grid* is another powerful tool to solve this problem. Unlike Flex, CSS Grid Layout is a two-dimensional layout system for content on the page.\n\nIt is important to note that Grid doesn't replace Flex. These are two different modules that work perfectly together.\n\n### Practice\n\nMany of the lessons in this course will include a practice section with a web view. Don't stop at the bare minimum in practice. When you finish an assignment, have a go and experiment a little with the code and the features you've learned.\n\nDuring the course, you'll come across independent assignments. Also, there are code samples for you to study or to look for clues.\n\n### CodePen\n\nAnother opportunity to apply the skills you learn in the course is to use [CodePen](https://codepen.io). You can create your own **pen**, and use it to experiment with positioning.\n\nIn each lesson of the course, there'll be examples from **CodePen**. They're available for review, and you can make edits in real-time and monitor the result. Don't miss out on this opportunity.\n"},"id":342,"slug":"css-grid","challenges_count":5,"name":"CSS: Layout on the Grid","allow_indexing":true,"state":"approved","course_state":"finished","pricing_type":"paid","description":"This course is dedicated to the CSS Grid Layout module, a technological tool for creating grids in CSS. After the Flex module arrived, there was a need to control elements in two axes simultaneously. The developers wanted to take the grid system used in print products for a hundred years. To do this, they used a table layout using Float and Flex. Each of these methods had limitations and development challenges. CSS Grid Layout appeared in 2011 and has acquired many features and approaches that make it easier to create layouts using CSS.","kind":"basic","updated_at":"2026-01-20T11:51:51.539Z","language":"html","duration_cache":18480,"skills":["The basic properties of CSS Grid Layout.","Create and manage the space within grids.","Manage the layout of HTML elements within a grid.","Adapt grids for different screen resolutions."],"keywords":[],"lessons_count":7,"cover":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6ODU4OSwicHVyIjoiYmxvYl9pZCJ9fQ==--2a4df319c27e67469d3cb2f82553cbec6d64e136/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fZmlsbCI6WzYwMCw0MDBdfSwicHVyIjoidmFyaWF0aW9uIn19--39ba06fa99226096df9fc6bb31f84e1d29ea98e9/image.png"},"recommendedLandings":[{"stack":{"id":142,"slug":"layout-designer-positioning","title":"Position CSS","audience":"for_programmers","start_type":"anytime","pricing_model":"subscription","priority":"medium","kind":"track","state":"published","stack_state":"finished","order":null,"duration_in_months":2},"id":239,"slug":"layout-designer-positioning","title":"Position CSS","subtitle":"Skill in creating responsive interfaces for building convenient, functional solutions across a wide range of devices","subtitle_for_lists":"","locale":"en","current":true,"duration_in_months_text":"2 months","stack_slug":"layout-designer-positioning","price_text":"from $49","duration_text":"2 months","cover_list_variant":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTIzMzUsInB1ciI6ImJsb2JfaWQifX0=--f8607de9d6d23daf38a4dc6c25bda62ecf665f95/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Hand%20coding-cuate.png"}],"lessonMemberUnit":null,"accessToLearnUnitExists":false,"accessToCourseExists":false},"url":"/courses/css-grid/lessons/grid-property/theory_unit","version":"1656487db0d1dd5f33634fe1070e57e55135cbeb","encryptHistory":false,"clearHistory":false}"><style data-mantine-styles="true">:root, :host{--mantine-font-family: Arial, sans-serif;--mantine-font-family-headings: Arial, sans-serif;--mantine-heading-font-weight: normal;--mantine-radius-default: 0rem;--mantine-primary-color-filled: var(--mantine-color-indigo-filled);--mantine-primary-color-filled-hover: var(--mantine-color-indigo-filled-hover);--mantine-primary-color-light: var(--mantine-color-indigo-light);--mantine-primary-color-light-hover: var(--mantine-color-indigo-light-hover);--mantine-primary-color-light-color: var(--mantine-color-indigo-light-color);--mantine-spacing-xxl: calc(4rem * var(--mantine-scale));--mantine-font-size-xs: 12px;--mantine-font-size-sm: 14px;--mantine-font-size-md: 16px;--mantine-font-size-lg: clamp(16.0000px, calc(15.2727px + 0.2273vw), 18.0000px);--mantine-font-size-xl: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-font-size-display-3: clamp(32.0000px, calc(26.1818px + 1.8182vw), 48.0000px);--mantine-font-size-display-2: clamp(36.0000px, calc(25.8182px + 3.1818vw), 64.0000px);--mantine-font-size-display-1: clamp(40.0000px, calc(25.4545px + 4.5455vw), 80.0000px);--mantine-font-size-h1: clamp(28.0000px, calc(23.6364px + 1.3636vw), 40.0000px);--mantine-font-size-h2: clamp(24.0000px, calc(21.0909px + 0.9091vw), 32.0000px);--mantine-font-size-h3: clamp(20.0000px, calc(17.0909px + 0.9091vw), 28.0000px);--mantine-font-size-h4: clamp(16.0000px, calc(13.0909px + 0.9091vw), 24.0000px);--mantine-font-size-h5: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-font-size-h6: 1rem;--mantine-primary-color-0: var(--mantine-color-indigo-0);--mantine-primary-color-1: var(--mantine-color-indigo-1);--mantine-primary-color-2: var(--mantine-color-indigo-2);--mantine-primary-color-3: var(--mantine-color-indigo-3);--mantine-primary-color-4: var(--mantine-color-indigo-4);--mantine-primary-color-5: var(--mantine-color-indigo-5);--mantine-primary-color-6: var(--mantine-color-indigo-6);--mantine-primary-color-7: var(--mantine-color-indigo-7);--mantine-primary-color-8: var(--mantine-color-indigo-8);--mantine-primary-color-9: var(--mantine-color-indigo-9);--mantine-color-red-0: #ffeaea;--mantine-color-red-1: #fed4d4;--mantine-color-red-2: #f4a7a8;--mantine-color-red-3: #ec7878;--mantine-color-red-4: #e55050;--mantine-color-red-5: #e03131;--mantine-color-red-6: #e02829;--mantine-color-red-7: #c71a1c;--mantine-color-red-8: #b21218;--mantine-color-red-9: #9c0411;--mantine-color-violet-0: #fce9ff;--mantine-color-violet-1: #f1cfff;--mantine-color-violet-2: #e09bff;--mantine-color-violet-3: #d16fff;--mantine-color-violet-4: #be37fe;--mantine-color-violet-5: #b51afe;--mantine-color-violet-6: #b009ff;--mantine-color-violet-7: #9b00e4;--mantine-color-violet-8: #8a00cc;--mantine-color-violet-9: #7800b3;--mantine-color-indigo-0: #edecff;--mantine-color-indigo-1: #d6d5fe;--mantine-color-indigo-2: #aaa9f4;--mantine-color-indigo-3: #7b79eb;--mantine-color-indigo-4: #5451e4;--mantine-color-indigo-5: #3b37e0;--mantine-color-indigo-6: #2d2adf;--mantine-color-indigo-7: #1f1ec7;--mantine-color-indigo-8: #1819b2;--mantine-color-indigo-9: #0c149e;--mantine-color-cyan-0: #dffdff;--mantine-color-cyan-1: #caf5ff;--mantine-color-cyan-2: #99e8ff;--mantine-color-cyan-3: #64daff;--mantine-color-cyan-4: #3ccffe;--mantine-color-cyan-5: #24c8fe;--mantine-color-cyan-6: #00c2ff;--mantine-color-cyan-7: #00ade4;--mantine-color-cyan-8: #009acd;--mantine-color-cyan-9: #0085b5;--mantine-color-green-0: #e9fdec;--mantine-color-green-1: #d7f6dc;--mantine-color-green-2: #b0eab9;--mantine-color-green-3: #86df94;--mantine-color-green-4: #62d574;--mantine-color-green-5: #4ccf5f;--mantine-color-green-6: #3fcc54;--mantine-color-green-7: #2fb344;--mantine-color-green-8: #25a03b;--mantine-color-green-9: #138a2e;--mantine-color-yellow-0: #fff7e2;--mantine-color-yellow-1: #ffeecd;--mantine-color-yellow-2: #ffdc9c;--mantine-color-yellow-3: #ffc966;--mantine-color-yellow-4: #feb93a;--mantine-color-yellow-5: #feae1e;--mantine-color-yellow-6: #ffa90f;--mantine-color-yellow-8: #ca8200;--mantine-color-yellow-9: #af7000;--mantine-h1-font-size: clamp(28.0000px, calc(23.6364px + 1.3636vw), 40.0000px);--mantine-h1-font-weight: normal;--mantine-h2-font-size: clamp(24.0000px, calc(21.0909px + 0.9091vw), 32.0000px);--mantine-h2-font-weight: normal;--mantine-h3-font-size: clamp(20.0000px, calc(17.0909px + 0.9091vw), 28.0000px);--mantine-h3-font-weight: normal;--mantine-h4-font-size: clamp(16.0000px, calc(13.0909px + 0.9091vw), 24.0000px);--mantine-h4-font-weight: normal;--mantine-h5-font-size: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-h5-font-weight: normal;--mantine-h6-font-size: 1rem;--mantine-h6-font-weight: normal;}
:root[data-mantine-color-scheme="dark"], :host([data-mantine-color-scheme="dark"]){--mantine-color-anchor: var(--mantine-color-text);--mantine-color-dimmed: #495057;--mantine-color-dark-filled: var(--mantine-color-dark-5);--mantine-color-dark-filled-hover: var(--mantine-color-dark-6);--mantine-color-dark-light: rgba(105, 105, 105, 0.15);--mantine-color-dark-light-hover: rgba(105, 105, 105, 0.2);--mantine-color-dark-light-color: var(--mantine-color-dark-0);--mantine-color-dark-outline: var(--mantine-color-dark-1);--mantine-color-dark-outline-hover: rgba(184, 184, 184, 0.05);--mantine-color-gray-filled: var(--mantine-color-gray-5);--mantine-color-gray-filled-hover: var(--mantine-color-gray-6);--mantine-color-gray-light: rgba(222, 226, 230, 0.15);--mantine-color-gray-light-hover: rgba(222, 226, 230, 0.2);--mantine-color-gray-light-color: var(--mantine-color-gray-0);--mantine-color-gray-outline: var(--mantine-color-gray-1);--mantine-color-gray-outline-hover: rgba(241, 243, 245, 0.05);--mantine-color-red-filled: var(--mantine-color-red-5);--mantine-color-red-filled-hover: var(--mantine-color-red-6);--mantine-color-red-light: rgba(236, 120, 120, 0.15);--mantine-color-red-light-hover: rgba(236, 120, 120, 0.2);--mantine-color-red-light-color: var(--mantine-color-red-0);--mantine-color-red-outline: var(--mantine-color-red-1);--mantine-color-red-outline-hover: rgba(254, 212, 212, 0.05);--mantine-color-pink-filled: var(--mantine-color-pink-5);--mantine-color-pink-filled-hover: var(--mantine-color-pink-6);--mantine-color-pink-light: rgba(250, 162, 193, 0.15);--mantine-color-pink-light-hover: rgba(250, 162, 193, 0.2);--mantine-color-pink-light-color: var(--mantine-color-pink-0);--mantine-color-pink-outline: var(--mantine-color-pink-1);--mantine-color-pink-outline-hover: rgba(255, 222, 235, 0.05);--mantine-color-grape-filled: var(--mantine-color-grape-5);--mantine-color-grape-filled-hover: var(--mantine-color-grape-6);--mantine-color-grape-light: rgba(229, 153, 247, 0.15);--mantine-color-grape-light-hover: rgba(229, 153, 247, 0.2);--mantine-color-grape-light-color: var(--mantine-color-grape-0);--mantine-color-grape-outline: var(--mantine-color-grape-1);--mantine-color-grape-outline-hover: rgba(243, 217, 250, 0.05);--mantine-color-violet-filled: var(--mantine-color-violet-5);--mantine-color-violet-filled-hover: var(--mantine-color-violet-6);--mantine-color-violet-light: rgba(209, 111, 255, 0.15);--mantine-color-violet-light-hover: rgba(209, 111, 255, 0.2);--mantine-color-violet-light-color: var(--mantine-color-violet-0);--mantine-color-violet-outline: var(--mantine-color-violet-1);--mantine-color-violet-outline-hover: rgba(241, 207, 255, 0.05);--mantine-color-indigo-filled: var(--mantine-color-indigo-5);--mantine-color-indigo-filled-hover: var(--mantine-color-indigo-6);--mantine-color-indigo-light: rgba(123, 121, 235, 0.15);--mantine-color-indigo-light-hover: rgba(123, 121, 235, 0.2);--mantine-color-indigo-light-color: var(--mantine-color-indigo-0);--mantine-color-indigo-outline: var(--mantine-color-indigo-1);--mantine-color-indigo-outline-hover: rgba(214, 213, 254, 0.05);--mantine-color-blue-filled: var(--mantine-color-blue-5);--mantine-color-blue-filled-hover: var(--mantine-color-blue-6);--mantine-color-blue-light: rgba(116, 192, 252, 0.15);--mantine-color-blue-light-hover: rgba(116, 192, 252, 0.2);--mantine-color-blue-light-color: var(--mantine-color-blue-0);--mantine-color-blue-outline: var(--mantine-color-blue-1);--mantine-color-blue-outline-hover: rgba(208, 235, 255, 0.05);--mantine-color-cyan-filled: var(--mantine-color-cyan-5);--mantine-color-cyan-filled-hover: var(--mantine-color-cyan-6);--mantine-color-cyan-light: rgba(100, 218, 255, 0.15);--mantine-color-cyan-light-hover: rgba(100, 218, 255, 0.2);--mantine-color-cyan-light-color: var(--mantine-color-cyan-0);--mantine-color-cyan-outline: var(--mantine-color-cyan-1);--mantine-color-cyan-outline-hover: rgba(202, 245, 255, 0.05);--mantine-color-teal-filled: var(--mantine-color-teal-5);--mantine-color-teal-filled-hover: var(--mantine-color-teal-6);--mantine-color-teal-light: rgba(99, 230, 190, 0.15);--mantine-color-teal-light-hover: rgba(99, 230, 190, 0.2);--mantine-color-teal-light-color: var(--mantine-color-teal-0);--mantine-color-teal-outline: var(--mantine-color-teal-1);--mantine-color-teal-outline-hover: rgba(195, 250, 232, 0.05);--mantine-color-green-filled: var(--mantine-color-green-5);--mantine-color-green-filled-hover: var(--mantine-color-green-6);--mantine-color-green-light: rgba(134, 223, 148, 0.15);--mantine-color-green-light-hover: rgba(134, 223, 148, 0.2);--mantine-color-green-light-color: var(--mantine-color-green-0);--mantine-color-green-outline: var(--mantine-color-green-1);--mantine-color-green-outline-hover: rgba(215, 246, 220, 0.05);--mantine-color-lime-filled: var(--mantine-color-lime-5);--mantine-color-lime-filled-hover: var(--mantine-color-lime-6);--mantine-color-lime-light: rgba(192, 235, 117, 0.15);--mantine-color-lime-light-hover: rgba(192, 235, 117, 0.2);--mantine-color-lime-light-color: var(--mantine-color-lime-0);--mantine-color-lime-outline: var(--mantine-color-lime-1);--mantine-color-lime-outline-hover: rgba(233, 250, 200, 0.05);--mantine-color-yellow-filled: var(--mantine-color-yellow-5);--mantine-color-yellow-filled-hover: var(--mantine-color-yellow-6);--mantine-color-yellow-light: rgba(255, 201, 102, 0.15);--mantine-color-yellow-light-hover: rgba(255, 201, 102, 0.2);--mantine-color-yellow-light-color: var(--mantine-color-yellow-0);--mantine-color-yellow-outline: var(--mantine-color-yellow-1);--mantine-color-yellow-outline-hover: rgba(255, 238, 205, 0.05);--mantine-color-orange-filled: var(--mantine-color-orange-5);--mantine-color-orange-filled-hover: var(--mantine-color-orange-6);--mantine-color-orange-light: rgba(255, 192, 120, 0.15);--mantine-color-orange-light-hover: rgba(255, 192, 120, 0.2);--mantine-color-orange-light-color: var(--mantine-color-orange-0);--mantine-color-orange-outline: var(--mantine-color-orange-1);--mantine-color-orange-outline-hover: rgba(255, 232, 204, 0.05);--app-cta-gradient: linear-gradient(90deg, var(--mantine-color-blue-9) 0%, var(--mantine-color-cyan-7) 100%);--app-color-surface: #2e2e2e;}
:root[data-mantine-color-scheme="light"], :host([data-mantine-color-scheme="light"]){--mantine-color-anchor: var(--mantine-color-text);--mantine-color-dimmed: #495057;--mantine-color-red-light: rgba(224, 40, 41, 0.1);--mantine-color-red-light-hover: rgba(224, 40, 41, 0.12);--mantine-color-red-outline-hover: rgba(224, 40, 41, 0.05);--mantine-color-violet-light: rgba(176, 9, 255, 0.1);--mantine-color-violet-light-hover: rgba(176, 9, 255, 0.12);--mantine-color-violet-outline-hover: rgba(176, 9, 255, 0.05);--mantine-color-indigo-light: rgba(45, 42, 223, 0.1);--mantine-color-indigo-light-hover: rgba(45, 42, 223, 0.12);--mantine-color-indigo-outline-hover: rgba(45, 42, 223, 0.05);--mantine-color-cyan-light: rgba(0, 194, 255, 0.1);--mantine-color-cyan-light-hover: rgba(0, 194, 255, 0.12);--mantine-color-cyan-outline-hover: rgba(0, 194, 255, 0.05);--mantine-color-green-light: rgba(63, 204, 84, 0.1);--mantine-color-green-light-hover: rgba(63, 204, 84, 0.12);--mantine-color-green-outline-hover: rgba(63, 204, 84, 0.05);--mantine-color-yellow-light: rgba(255, 169, 15, 0.1);--mantine-color-yellow-light-hover: rgba(255, 169, 15, 0.12);--mantine-color-yellow-outline-hover: rgba(255, 169, 15, 0.05);--app-color-surface: #f1f3f5;--app-cta-gradient: linear-gradient(90deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-5) 100%);}</style><style data-mantine-styles="classes">@media (max-width: 35.99375em) {.mantine-visible-from-xs {display: none !important;}}@media (min-width: 36em) {.mantine-hidden-from-xs {display: none !important;}}@media (max-width: 47.99375em) {.mantine-visible-from-sm {display: none !important;}}@media (min-width: 48em) {.mantine-hidden-from-sm {display: none !important;}}@media (max-width: 61.99375em) {.mantine-visible-from-md {display: none !important;}}@media (min-width: 62em) {.mantine-hidden-from-md {display: none !important;}}@media (max-width: 74.99375em) {.mantine-visible-from-lg {display: none !important;}}@media (min-width: 75em) {.mantine-hidden-from-lg {display: none !important;}}@media (max-width: 87.99375em) {.mantine-visible-from-xl {display: none !important;}}@media (min-width: 88em) {.mantine-hidden-from-xl {display: none !important;}}</style><div style="position:absolute;top:0rem" class=""></div><div style="max-width:var(--container-size-xl);height:100%;min-height:0rem" class=""><style data-mantine-styles="inline">.__m__-_R_5ub_{--grid-gutter:0rem;}</style><div style="height:100%;min-height:0rem" class="m_410352e9 mantine-Grid-root __m__-_R_5ub_"><div class="m_dee7bd2f mantine-Grid-inner" style="height:100%"><style data-mantine-styles="inline">.__m__-_R_rdub_{--col-flex-grow:auto;--col-flex-basis:91.66666666666667%;--col-max-width:91.66666666666667%;}@media(min-width: 48em){.__m__-_R_rdub_{--col-flex-grow:auto;--col-flex-basis:83.33333333333334%;--col-max-width:83.33333333333334%;}}</style><div style="min-width:0rem;height:100%;min-height:0rem;display:flex" class="m_96bdd299 mantine-Grid-col __m__-_R_rdub_"><style data-mantine-styles="inline">.__m__-_R_6qrdub_{margin-top:0rem;padding-inline:var(--mantine-spacing-xs);width:100%;}@media(min-width: 48em){.__m__-_R_6qrdub_{margin-top:var(--mantine-spacing-xl);width:80%;}}@media(min-width: 62em){.__m__-_R_6qrdub_{padding-inline:var(--mantine-spacing-xl);}}</style><div style="margin-inline:auto;max-width:var(--mantine-breakpoint-xl)" class="__m__-_R_6qrdub_"><div style="color:var(--mantine-color-dimmed)" class="m_4451eb3a mantine-Center-root" data-inline="true"><div style="--ti-size:var(--ti-size-xs);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;margin-inline-end:calc(0.125rem * var(--mantine-scale));color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="xs"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-lock "><path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path></svg></div><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">CSS: Layout on the Grid</p></div><h1 style="--title-fw:var(--mantine-h1-font-weight);--title-lh:var(--mantine-h1-line-height);--title-fz:var(--mantine-h1-font-size);margin-bottom:var(--mantine-spacing-xl)" class="m_8a5d1357 mantine-Title-root" data-order="1">Theory: Working with a grid</h1><script type="application/ld+json">{"@context":"https://schema.org","@type":"LearningResource","name":"Working with a grid","inLanguage":"en","isPartOf":{"@type":"LearningResource","name":"CSS: Layout on the Grid"},"isAccessibleForFree":"False","hasPart":{"@type":"WebPageElement","isAccessibleForFree":"False","cssSelector":".paywalled"}}</script><div class=""><div style="--alert-color:var(--mantine-color-indigo-light-color);margin-bottom:var(--mantine-spacing-lg);font-size:var(--mantine-font-size-lg)" class="m_66836ed3 mantine-Alert-root" id="mantine-_R_remqrdub_" role="alert" aria-describedby="mantine-_R_remqrdub_-body" aria-labelledby="mantine-_R_remqrdub_-title"><div class="m_a5d60502 mantine-Alert-wrapper"><div class="m_667f2a6a mantine-Alert-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-rocket "><path d="M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3"></path><path d="M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3"></path><path d="M14 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"></path></svg></div><div class="m_667c2793 mantine-Alert-body"><div class="m_6a03f287 mantine-Alert-title"><span id="mantine-_R_remqrdub_-title" class="m_698f4f23 mantine-Alert-label">Full access to materials</span></div><div id="mantine-_R_remqrdub_-body" class="m_7fa78076 mantine-Alert-message"><div style="--group-gap:var(--mantine-spacing-md);--group-align:center;--group-justify:space-between;--group-wrap:wrap" class="m_4081bf90 mantine-Group-root"><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Sign up and get access to this and dozens of other courses</p><a style="--button-height:var(--button-height-xs);--button-padding-x:var(--button-padding-x-xs);--button-fz:var(--mantine-font-size-xs);--button-bg:linear-gradient(45deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-filled) 100%);--button-hover:linear-gradient(45deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-filled) 100%);--button-color:var(--mantine-color-white);--button-bd:none" class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root" data-variant="gradient" data-size="xs" href="/u/new"><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label">Sign up</span></span></a></div></div></div></div></div><div class="paywalled m_d08caa0 mantine-Typography-root"><p>In the lesson on <em>Grid</em> module terminology, we showed you the <em>Hexlet</em> blog and an example of the grid it uses. You may have noticed that in addition to the strips themselves that the content lines up directly alongside, this grid used indents between the bars. They were highlighted in orange in the image.</p>
<p><img style="--image-object-fit:contain;width:auto" class="m_9e117634 mantine-Image-root" src="/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6ODYyNywicHVyIjoiYmxvYl9pZCJ9fQ==--18ee6f9ed719a80f384bd76a67d45b23fad373ab/12col-grid.jpg" alt="Hexlet's Grid Blog" loading="lazy"/></p>
<p>So what are they for? Often, all of our content inside the cells takes up the full width. In this case, column indentation is a substitute for the <em>margin</em> property, but with one essential condition: the <em>Grid</em> module automatically indents only where necessary. This means that there's no need to override unnecessary <em>margin</em> in the first or last strips of the grid during development.</p>
<p>Separately, it is worth mentioning that these indents do not work - they will be added to the width of the stripes within which the element is located. There will be no indentation inside the element itself.</p>
<p>Let's move on from theory to practice. Let's take one of the examples from the previous lessons. It shows a typical two-column layout, which is often found in development. For convenience, in addition to defining <em>Grid-areas</em>, we'll set the width of each column as 100 pixels in this lesson:</p>
<iframe height="348" style="width:100%" scrolling="no" title="css_grid_property_example" src="https://codepen.io/hexlet/embed/WNKWzvo?default-tab=result&editable=true&theme-id=light" frameBorder="no" loading="lazy" allowTransparency="true" allowFullScreen="">
See the Pen <a href="https://codepen.io/hexlet/pen/WNKWzvo">
css_grid_property_example</a> by Hexlet (<a href="https://codepen.io/hexlet">@hexlet</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>
<p>Pay special attention to how the <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-template-areas</code>, <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-template-columns</code>/<code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-template-rows</code> properties work together. As you can see, they're not a substitute for each other, they actually work well together.</p>
<p>This example shows a layout consisting of 6 columns. At the moment, there's no indentation between the sidebar and the main content. This usually has a bad effect on the readability of the information in the layout, as the texts in the two different elements start to stick together.</p>
<iframe height="346" style="width:100%" scrolling="no" title="css_grid_property_example_2" src="https://codepen.io/hexlet/embed/yLqrKYo?default-tab=result&editable=true&theme-id=light" frameBorder="no" loading="lazy" allowTransparency="true" allowFullScreen="">
See the Pen <a href="https://codepen.io/hexlet/pen/yLqrKYo">
css_grid_property_example_2</a> by Hexlet (<a href="https://codepen.io/hexlet">@hexlet</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>
<p>To solve the problem with creating indents between <em>Grid-bars</em> there are 2 properties: <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-column-gap</code> and <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-row-gap</code>. As you can guess from the name, the first property is responsible for the indent between columns, and the second property is the indent between rows. The property's value is any unit available in <em>CSS</em>. Pixels, percentages, or any other unit of measurement.</p>
<p>Create an indentation in our two-column layouts, measuring 30 pixels between columns. To do this, you need to set the <em>container</em> to the necessary value.</p>
<iframe height="357" style="width:100%" scrolling="no" title="css_grid_property_gap_column" src="https://codepen.io/hexlet/embed/oNMOqjm?default-tab=result&editable=true&theme-id=light" frameBorder="no" loading="lazy" allowTransparency="true" allowFullScreen="">
See the Pen <a href="https://codepen.io/hexlet/pen/oNMOqjm">
css_grid_property_gap_column</a> by Hexlet (<a href="https://codepen.io/hexlet">@hexlet</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>
<p>If you look at the resulting layout with <em>Chrome DevTools</em>, we get the following:</p>
<p><img style="--image-object-fit:contain;width:auto" class="m_9e117634 mantine-Image-root" src="/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6ODYyOCwicHVyIjoiYmxvYl9pZCJ9fQ==--f76180abb1e105ce3e3b0e727da0a514c08c5b51/grid-gap-1.png" alt="Grid Gap in a two-column layout" loading="lazy"/></p>
<p>Note the indentation between columns and the fact that, despite them being there, no indentation has appeared within the elements. The indentations have become part of our elements. And the required indentation of 30 pixels has appeared between the sidebar and main content.</p>
<hr/>
<p>As it happens, the <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-column-gap</code> and <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-row-gap</code> properties are slowly being removed from the standard. The <em>CSS</em> specification now allows you to set exactly the same indentation in the <em>Flex</em> module to get away from the current problems with negative indentation when creating layouts. Therefore, a decision was taken to make the rules for both <em>Flex</em> and <em>Grid</em> the same. The new versions of the properties got rid of the <em>grid-*</em> and are now simply called <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">column-gap</code> and <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">row-gap</code>.</p>
<p>As of mid-2020, almost all browsers support these properties. The exceptions are older browsers, pre-2018 versions, and <em>Safari</em>, which only knows how to work with <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-column-gap</code> and <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-row-gap</code>. Keep a close eye on this point when you're developing pages. You can always keep track of this information using <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://caniuse.com/" rel="noopener noreferrer" target="_blank">Can I use</a>, which is an indispensable assistant for any layout designer.</p>
<hr/>
<p>For convenience, the developers of <em>CSS Grid Layout</em> have added a shortened <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-gap</code> property (or simply <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">gap</code>) to allow you to specify the indents between columns and rows in one single property. The <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">grid-gap</code> property can take two values:</p>
<ul>
<li>Indent between rows.</li>
<li>Indent between columns.</li>
</ul>
<p>If you specify only one value in the property, the browser will set this indent for both columns and rows.</p>
<iframe height="390" style="width:100%" scrolling="no" title="css_grid_property_gap_column_2" src="https://codepen.io/hexlet/embed/poZBLEr?default-tab=result&editable=true&theme-id=light" frameBorder="no" loading="lazy" allowTransparency="true" allowFullScreen="">
See the Pen <a href="https://codepen.io/hexlet/pen/poZBLEr">
css_grid_property_gap_column_2</a> by Hexlet (<a href="https://codepen.io/hexlet">@hexlet</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>
<h2 id="heading-2-1">Strip positioning</h2>
<p>There are two properties in <em>CSS Grid Layout</em> that allow you to automatically align the strips inside the container. These are the <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">justify-content</code> and <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">align-content</code> properties. Does that remind you of anything? If you've taken the <em>Flex</em> course, you'll have recognized these properties. Now you can see how closely the <em>CSS Flexible Box Layout</em> and <em>CSS Grid Layout</em> modules are related. When you develop with these two modules, you'll often use the same properties, which, as you can easily guess, also have the same values. Let's look at them. As an example, let's take three strips, each with a different color, to see the difference more clearly. The container itself will be painted gray so you can see its width.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify" src="https://codepen.io/hexlet/embed/ExPbPRW?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/ExPbPRW'>css_grid_property_justify</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<h3 id="heading-3-2">justify-content</h3>
<p>The <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">justify-content</code> property allows you to align the <em>Grid-bars</em> horizontally. I.e., the columns are aligned with the container. As in the <em>Flex</em> module, the <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">justify-content</code> property can take the following values:</p>
<p><strong>start</strong> — is the normal behavior of elements within a container. All of our columns start from the left edge and run horizontally one after another. Examples in this case will be superfluous.</p>
<p><strong>end</strong> — With this value, all elements inside the container will be shifted to the right border.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify_end" src="https://codepen.io/hexlet/embed/gOPXPZq?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/gOPXPZq'>css_grid_property_justify_end</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<p><strong>center</strong> — As the name implies, all elements inside the container will be centered inside the container.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify_center" src="https://codepen.io/hexlet/embed/KKVyVEd?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/KKVyVEd'>css_grid_property_justify_center</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<p><strong>stretch</strong> — This property is the default value when the columns are not set to a fixed width. To visualize this, let's change the example a bit. Let's make columns with an automatic width. Blocks with a dark border are elements in a container. Each element is 40 pixels wide and 40 pixels tall.</p>
<p>Be sure to try changing the <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">justify-content</code> values in this example to see how the elements behave when you use the values you already know.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify_stretch" src="https://codepen.io/hexlet/embed/wvMPMOL?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/wvMPMOL'>css_grid_property_justify_stretch</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<p><strong>space-around</strong>. Here everything works exactly the same way as in <em>Flex</em>. The <em>space-around</em> value will make equal indentation between columns, and half that distance along the edges of the container.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify_around" src="https://codepen.io/hexlet/embed/zYrPqdW?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/zYrPqdW'>css_grid_property_justify_around</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<p><strong>space-evenly</strong>. The value works the same way as <em>space-around</em> with one exception; the indents on the edges of the container are set to full width instead of half the distance between elements.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify_evenly" src="https://codepen.io/hexlet/embed/BajmKmo?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/BajmKmo'>css_grid_property_justify_evenly</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<p><strong>space-between</strong>. With this value, all elements have the same distance between them. There is no indentation from the edges. The first and last element are pressed against the edges of the container. If there are only two of these elements, they will be located on the edges of the container.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_justify_between" src="https://codepen.io/hexlet/embed/BajmKYj?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/BajmKYj'>css_grid_property_justify_between</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<h3 id="heading-3-3">align-content</h3>
<p>The <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">align-content</code> property is very similar in behavior to the <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">justify-content</code> property. The only difference is the direction of alignment. <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">justify-content</code> aligns the columns inside the container, and <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">align-content</code> aligns the rows inside the container. For demonstration purposes, we'll use an example from <em>codepen</em>, which we'll use to show all the values the property takes.</p>
<iframe height="265" style="width:100%" scrolling="no" title="css_grid_property_align_content" src="https://codepen.io/hexlet/embed/bGEYpxw?height=265&theme-id=light&default-tab=css,result&editable=true" frameBorder="no" allowTransparency="true" allowFullScreen="">
See the Pen <a href='https://codepen.io/hexlet/pen/bGEYpxw'>css_grid_property_align_content</a> by Hexlet
(<a href='https://codepen.io/hexlet'>@hexlet</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe></div><div style="margin-block:var(--mantine-spacing-xl)" class=""><h2 style="--title-fw:var(--mantine-h2-font-weight);--title-lh:var(--mantine-h2-line-height);--title-fz:var(--mantine-h2-font-size);margin-bottom:var(--mantine-spacing-md)" class="m_8a5d1357 mantine-Title-root" data-order="2">Recommended programs</h2><style data-mantine-styles="inline">.__m__-_R_2mremqrdub_{--carousel-slide-gap:var(--mantine-spacing-xs);--carousel-slide-size:70%;}@media(min-width: 36em){.__m__-_R_2mremqrdub_{--carousel-slide-gap:var(--mantine-spacing-xl);--carousel-slide-size:50%;}}</style><div style="--carousel-control-size:calc(2.5rem * var(--mantine-scale));--carousel-controls-offset:var(--mantine-spacing-sm);margin-bottom:var(--mantine-spacing-lg);padding-block:var(--mantine-spacing-sm);background:var(--app-color-surface)" class="m_17884d0f mantine-Carousel-root responsiveClassName" data-orientation="horizontal" data-include-gap-in-size="true"><div class="m_39bc3463 mantine-Carousel-controls" data-orientation="horizontal"><button class="mantine-focus-auto m_64f58e10 mantine-Carousel-control m_87cf2631 mantine-UnstyledButton-root" type="button" data-inactive="true" data-type="previous" tabindex="-1"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(90deg);width:calc(1rem * var(--mantine-scale));height:calc(1rem * var(--mantine-scale));display:block"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg></button><button class="mantine-focus-auto m_64f58e10 mantine-Carousel-control m_87cf2631 mantine-UnstyledButton-root" type="button" data-inactive="true" data-type="next" tabindex="-1"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(-90deg);width:calc(1rem * var(--mantine-scale));height:calc(1rem * var(--mantine-scale));display:block"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg></button></div><div class="m_a2dae653 mantine-Carousel-viewport" data-type="media"><div class="m_fcd81474 mantine-Carousel-container __m__-_R_2mremqrdub_" data-orientation="horizontal"><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/programs/layout-designer-positioning?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card" target="_blank"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><div style="--group-gap:calc(0.25rem * var(--mantine-scale));--group-align:center;--group-justify:flex-start;--group-wrap:nowrap" class="m_4081bf90 mantine-Group-root"><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">2 months</span><span class="mantine-focus-auto m_b6d8b162 mantine-Text-root">·</span><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">For advanced</span></div><p style="margin-bottom:var(--mantine-spacing-sm);font-size:var(--mantine-font-size-h5);font-weight:bold" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Position CSS</p><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root"></p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTIzMzUsInB1ciI6ImJsb2JfaWQifX0=--f8607de9d6d23daf38a4dc6c25bda62ecf665f95/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Hand%20coding-cuate.png" alt="Position CSS" loading="eager"/></div><div style="--group-gap:var(--mantine-spacing-md);--group-align:end;--group-justify:space-between;--group-wrap:wrap;margin-top:var(--mantine-spacing-xs)" class="m_4081bf90 mantine-Group-root"><p style="font-size:var(--mantine-font-size-xl)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">from $49</p><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Explore →</p></div></div></div></a></div></div><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><h2 style="--title-fw:var(--mantine-h2-font-weight);--title-lh:var(--mantine-h2-line-height);--title-fz:var(--mantine-h2-font-size);margin-bottom:var(--mantine-spacing-md);font-size:var(--mantine-font-size-h3)" class="m_8a5d1357 mantine-Title-root" data-order="2" data-responsive="true">Catalog</h2><p style="margin-bottom:auto" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">A complete list of available courses by direction</p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="/vite/assets/development-BVihs_d5.png" alt="Orientation"/></div></div></div></a></div></div></div></div></div></div></div></div></div><style data-mantine-styles="inline">.__m__-_R_1bdub_{--col-flex-grow:auto;--col-flex-basis:8.333333333333334%;--col-max-width:8.333333333333334%;}@media(min-width: 48em){.__m__-_R_1bdub_{--col-flex-grow:auto;--col-flex-basis:16.666666666666668%;--col-max-width:16.666666666666668%;}}</style><div style="min-width:0rem;height:100%;min-height:0rem" class="m_96bdd299 mantine-Grid-col __m__-_R_1bdub_"><div style="margin-inline:var(--mantine-spacing-xs)" class="mantine-visible-from-sm"><button style="--button-color:var(--mantine-color-white);margin-bottom:var(--mantine-spacing-lg);text-decoration:none" class="mantine-focus-auto m_849cf0da mantine-focus-auto m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" data-disabled="true" data-block="true" disabled="" type="button"><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label"><span style="margin-inline-end:var(--mantine-spacing-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Next</span>→</span></span></button><a style="padding-inline:0rem" class="mantine-focus-auto m_f0824112 mantine-NavLink-root m_87cf2631 mantine-UnstyledButton-root"><span class="m_690090b5 mantine-NavLink-section" data-position="left"><div style="--ti-size:var(--ti-size-sm);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="sm"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-list-numbers "><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"></path><path d="M6 10v-6l-2 2"></path></svg></div></span><div class="m_f07af9d2 mantine-NavLink-body"><span class="m_1f6ac4c4 mantine-NavLink-label">Navigation</span><span class="m_57492dcc mantine-NavLink-description">Theory</span></div><span class="m_690090b5 mantine-NavLink-section" data-position="right"></span></a><div style="margin-block:var(--mantine-spacing-lg)" class="m_3eebeb36 mantine-Divider-root" data-orientation="horizontal" role="separator"></div><div style="margin-block:var(--mantine-spacing-lg)" class=""><div style="justify-content:space-between;margin-bottom:calc(0.1875rem * var(--mantine-scale));color:var(--mantine-color-dimmed);font-size:var(--mantine-font-size-xs)" class="m_8bffd616 mantine-Flex-root __m__-_R_qimrbdub_"><p style="font-size:var(--mantine-font-size-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Completed</p><p style="font-size:var(--mantine-font-size-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">0 / 7</p></div><div style="--progress-size:var(--progress-size-sm)" class="m_db6d6462 mantine-Progress-root" data-size="sm"><div style="--progress-section-size:0%;--progress-section-color:var(--mantine-color-gray-filled)" class="m_2242eb65 mantine-Progress-section" role="progressbar" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" aria-valuetext="0%"></div></div></div><div style="--toc-bg:var(--mantine-color-blue-light);--toc-color:var(--mantine-color-blue-light-color);--toc-size:var(--mantine-font-size-sm);--toc-radius:var(--mantine-radius-sm);margin-top:var(--mantine-spacing-xl)" class="m_bcaa9990 mantine-TableOfContents-root" data-variant="light" data-size="sm"></div></div><div class="mantine-hidden-from-sm"><div style="--stack-gap:0rem;--stack-align:stretch;--stack-justify:flex-start" class="m_6d731127 mantine-Stack-root"><button style="--button-color:var(--mantine-color-white);margin-bottom:var(--mantine-spacing-xs);padding:0rem;text-decoration:none" class="mantine-focus-auto m_849cf0da mantine-focus-auto m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" data-disabled="true" data-block="true" disabled="" type="button"><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label">→</span></span></button><button style="--ai-size:var(--ai-size-sm);--ai-bg:transparent;--ai-hover:var(--mantine-color-indigo-light-hover);--ai-color:var(--mantine-color-indigo-light-color);--ai-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;padding-block:var(--mantine-spacing-lg);color:inherit;width:100%" class="mantine-focus-auto m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="subtle" data-size="sm" data-disabled="true" type="button" disabled=""><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-list-numbers "><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"></path><path d="M6 10v-6l-2 2"></path></svg></span></button></div></div></div></div></div></div></div>
</main>
<footer class="bg-dark fw-light text-light px-3 py-5">
<div class="row small">
<div class="col-12 col-sm-6 col-md-3">
<div class="h5 mb-3">About Hexlet</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/about">About us</a>
</li>
<li>
<span class="nav-link link-light py-1 ps-0 external-link" data-href="https://help.hexlet.io/category/4316" data-target="_blank" role="button">Help</span>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" target="_blank" rel="noopener noreferrer" href="/map">Site Map</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5 fw-normal mb-3">Learn</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_backend-development">Backend
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_devops">DevOps
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_frontend-development">Frontend
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_python">Python
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_testing">Testing
</a></li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5"><span class="translation_missing" title="translation missing: en.layouts.footer_content.popular_courses_for_beginners">Popular Courses For Beginners</span></div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/frontend">Frontend Developer</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5"><span class="translation_missing" title="translation missing: en.layouts.footer_content.popular_courses_for_advanced">Popular Courses For Advanced</span></div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/web-development-free">Fundamentals of Web Development</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/js-react-development">React</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/css-animation">CSS Animation</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/http-api">HTTP API</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/layout-designer-positioning">Position CSS</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/cli-basics">Command line basics</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/git-basics-free">Git fundamentals</a>
</li>
</ul>
</div>
</div>
<hr>
<div class="row">
<div class="col-12 col-sm-4 col-md-2">
<div class="fs-4">
<ul class="list-unstyled d-flex">
<li class="me-3">
<a aria-label="Facebook" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://www.facebook.com/hexlethq"><span class="bi bi-facebook"></span>
</a></li>
<li class="me-3">
<a aria-label="Instagram" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://www.instagram.com/hello_hexlet/"><span class="bi bi-instagram"></span>
</a></li>
<li>
<a aria-label="Twitter" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://twitter.com/Hexlet_IO"><span class="bi bi-twitter-x"></span>
</a></li>
</ul>
</div>
<div class="mb-2 d-flex flex-column">
<a class="link-light text-decoration-none" rel="nofollow" href="mailto:support@hexlet.io">support@hexlet.io</a>
<a class="link-light text-decoration-none py-2" target="_blank" href="https://t.me/hexlet_help_bot">t.me/hexlet_help_bot</a>
</div>
<ul class="list-unstyled d-flex">
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 opacity-100 external-link" rel="nofollow" data-href="https://hexlet.io/locale/switch?new_locale=en" data-target="_self" role="button"><span class="my-auto">EN</span>
</span></li>
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 external-link" rel="nofollow" data-href="https://ru.hexlet.io/locale/switch?new_locale=ru" data-target="_self" role="button"><span class="my-auto">RU</span>
</span></li>
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 external-link" rel="nofollow" data-href="https://kz.hexlet.io/locale/switch?new_locale=kz" data-target="_self" role="button"><span class="my-auto">KZ</span>
</span></li>
</ul>
</div>
<div class="col-12 col-sm-4 col-md-3">
<ul class="list-unstyled fs-4">
<li class="mb-3">
<a class="link-light text-decoration-none" href="tel:%2B7%20717%20272%2076%2070">+7 717 272 76 70</a>
<span class="d-block opacity-50 small">free call</span>
</li>
</ul>
</div>
<div class="col-12 col-sm-4 col-md-3">
<ul class="list-unstyled small">
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/legal">Legal</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/offer"><span class="translation_missing" title="translation missing: en.layouts.footer_content.offer">Offer</span></a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/contacts"><span class="translation_missing" title="translation missing: en.layouts.footer_content.contacts">Contacts</span></a>
</li>
</ul>
</div>
<div class="col-12 col-sm-12 col-md-4 small">
<div class="mb-2">
<div>TOO "Hexlet"</div>
<div>The Republic of Kazakhstan, Almaty</div>
<div>Auezova St., 14A</div>
<div>BIN 230340043714
</div>
</div>
</div>
</div>
</footer>
<div id="root-assistant-offcanvas"></div>
<script src="/vite/assets/assistant-CIOaBlj-.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/init-0bhwJkNI.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ErrorFallbackBlock-V3hfk_CP.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/MarkdownBlock-DejNWqwz.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/gon-B-jV56Ol.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/mantine-DOJkeu70.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/shiki-DZwEN4Zo.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/utils-ClTF9s_T.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-mvvEXZQ8.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/lib-CJocDKTE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Box-DH3_MBnL.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/notifications.store-Cj65YiRw.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useIsomorphicEffect-Csl7vw8x.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/lib-DeAQqnBE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/axios-CN66HKVH.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/classnames-DQgTDFJJ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dayjs.min-Bfba02I7.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/debounce-BcxwEZ7X.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/prop-types-DGBR76ns.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/client-CYyKzrjQ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-dom-SJZekO2j.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useTranslation-bo78L81P.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/compiler-runtime-BhqaZ6vG.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/jsx-runtime-DlXMvSuQ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-CFtMU8gd.js" as="script" crossorigin="anonymous">
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"version":"2024.11.0","token":"d11015b65d11429ea6b4a2ef37dd7e0b","server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>
</body>
</html>