{"id":325427,"date":"2021-06-24T15:00:37","date_gmt":"2021-06-24T15:00:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325427"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325427","title":{"rendered":"\u041f\u043e\u043b\u043d\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\/\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e CSS Grid"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ii\/wm\/o4\/iiwmo4xd5llqegxpezthtndpepq.png\">  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>CSS Grid<\/code> (\u0434\u0430\u043b\u0435\u0435 \u0442\u0430\u043a\u0436\u0435 \u2014 \u0413\u0440\u0438\u0434), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0438\u043b\u0438 \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u0435 \u043c\u0430\u043a\u0435\u0442\u044b \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0440\u0430\u0442\u043a\u043e, \u043d\u043e \u043f\u043e\u043b\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<p>  <\/p>\n<h2 id=\"chto-takoe-css-grid\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>CSS Grid<\/code>?<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/-h\/7z\/mx-h7zjpr1fuvcrok8mqkktk5lk.png\">  <\/p>\n<p>\u0413\u0440\u0438\u0434 \u2014 \u044d\u0442\u043e \u043c\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 (\u0435\u0433\u043e \u0441\u0445\u0435\u043c\u0430, \u043f\u0440\u043e\u0435\u043a\u0442).<\/p>\n<p>  <\/p>\n<p>\u0413\u0440\u0438\u0434-\u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0430\u0439\u0442\u0430 (\u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c). \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0430\u0439\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u043a\u0435\u0442\u0430 \u0441\u0430\u0439\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0413\u0440\u0438\u0434\u0430.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p><strong>\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440<\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/99\/2v\/na\/992vnakv8v0qksxal31q5vsamn0.png\">  <\/p>\n<p><strong>\u0422\u0435\u043b\u0435\u0444\u043e\u043d<\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r-\/t_\/gc\/r-t_gcd7hgsm-zvbzgsyvpuregc.png\">  <\/p>\n<h2 id=\"arhitektura-css-grid\">\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 <code>CSS Grid<\/code><\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0413\u0440\u0438\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0413\u0440\u0438\u0434\u0430 (grid items) \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432\u0434\u043e\u043b\u044c \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 (main) \u0438 \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0439 (cross) \u043e\u0441\u0438 (axis). \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/an\/y8\/cq\/any8cqemefqxxho6prfrqkmhmfe.png\">  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0432 <code>Excel<\/code>, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u0424\u043b\u0435\u043a\u0441 (<code>Flexbox<\/code>).<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0424\u043b\u0435\u043a\u0441, <a href=\"https:\/\/www.freecodecamp.org\/news\/css-flexbox-tutorial-with-cheatsheet\/\">\u0432\u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"shema-css-grid\">\u0421\u0445\u0435\u043c\u0430 <code>CSS Grid<\/code><\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qi\/m_\/tm\/qim_tmiyuiqnv_c9h6lhyn-nkds.png\">  <\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0413\u0440\u0438\u0434\u043e\u043c. \u042d\u0442\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 (\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u0440\u0438\u0434-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430) \u0438<\/li>\n<li>\u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 (\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u0440\u0438\u0434-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432)<\/li>\n<\/ul>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>: \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nk\/nk\/ta\/nknktaa_etpvvkn_is3niyp8av0.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/az\/n5\/ry\/azn5rydn_mgvw0opjrmtjfhvs6s.png\">  <\/p>\n<p>\u041a \u043a\u043e\u043d\u0446\u0443 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>  <\/p>\n<h2 id=\"nastroyka-proekta\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/az\/n5\/ry\/azn5rydn_mgvw0opjrmtjfhvs6s.png\">  <\/p>\n<p>\u0414\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f <code>HTML<\/code>, <code>CSS<\/code> \u0438 \u0443\u043c\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <code>VSCode<\/code> (\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043a\u0443\u0441\u0443). \u0414\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Project1<\/code> \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 (<code>cd Project1<\/code>, <code>code .<\/code>)<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b <code>index.html<\/code> \u0438 <code>style.css<\/code><\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432 <code>VSCode<\/code> \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (<code>Live Server<\/code>, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435) \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0418\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c <a href=\"https:\/\/codepen.io\/\"><code>Codepen<\/code><\/a> (\u0438\u043b\u0438 \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443) \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0434\u0435\u043b\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ee\/ue\/-u\/eeue-u-ldkqrz0aemc-3ouy9kqg.png\">  <\/p>\n<h2 id=\"html\"><code>HTML<\/code><\/h2>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c 3 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 <code>body<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;container&quot;&gt;   &lt;div class=&quot;box-1&quot;&gt; A &lt;\/div&gt;   &lt;div class=&quot;box-2&quot;&gt; B &lt;\/div&gt;   &lt;div class=&quot;box-3&quot;&gt; C &lt;\/div&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"css\"><code>CSS<\/code><\/h2>\n<p>  <\/p>\n<p><strong>\u0428\u0430\u0433 1<\/strong><\/p>\n<p>  <\/p>\n<p>\u0421\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0438\u043b\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">* {   margin: 0;   padding: 0;   box-sizing: border-box; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0428\u0430\u0433 2<\/strong><\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u0438\u0437\u0443\u0435\u043c <code>body<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">body {   font-family: sans-serif;   font-size: 40px;   width: 100%;   min-height: 100vh; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0428\u0430\u0433 3<\/strong><\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0438\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">[class^=&quot;box-&quot;] {   background-color: skyblue;   \/* \u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 *\/   display: grid;   place-items: center; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0413\u0440\u0438\u0434\u0430.<\/p>\n<p>  <\/p>\n<p><strong>\u0428\u0430\u0433 4<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0442\u0441\u0442\u0443\u043f \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 20px; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"pogodite-ka\">\u041f\u043e\u0433\u043e\u0434\u0438\u0442\u0435-\u043a\u0430<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/40\/0x\/wp\/400xwppgdqlr3kwvbekdqb5nznu.png\">  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1b\/qx\/we\/1bqxwe2fza-k-ofu2mhxi22lhg8.png\">  <\/p>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 <code>.container<\/code>, \u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 \u0432 <code>.box-*<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"svoystva-grid-konteynera\">\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u0440\u0438\u0434-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ka\/x-\/ho\/kax-ho2gxxhnhynmrwilmgc2z5i.png\">  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>  <\/p>\n<p><strong>grid-template-columns<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <strong>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0448\u0438\u0440\u0438\u043d\u044b<\/strong> \u043a\u043e\u043b\u043e\u043d\u043e\u043a. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0448\u0438\u0440\u0438\u043d\u0443 \u0432\u0441\u0435\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>repeat()<\/code>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/z2\/vz\/9v\/z2vz9vmfzphal8m9x0h-5xpplaq.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8b\/jr\/je\/8bjrjelv8uvir7xckxpr3e8eroi.png\">  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 <code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 20px;    \/* ! *\/   grid-template-columns: 200px auto 100px; }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u0445 \u0431\u0443\u0434\u0443\u0442 \u0442\u043e\u0447\u043d\u044b\u043c\u0438. \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>auto<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430<\/li>\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b <code>fr<\/code> (\u0444\u0440\u0430\u043a\u0446\u0438\u044f) \u0432 <code>repeat()<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443<\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>grid-template-rows<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <strong>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0432\u044b\u0441\u043e\u0442\u044b<\/strong> \u0441\u0442\u0440\u043e\u043a. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u0432\u044b\u0441\u043e\u0442\u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0441\u043e\u0442\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>repeat()<\/code>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/z8\/ww\/sb\/z8wwsbis02j3omdnlxpf9_yr56a.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ds\/wg\/2b\/dswg2bol6rxctuv-lidwzl1lxpg.png\">  <\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 <code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 20px;   height: 100vh;    \/* ! *\/   grid-template-rows: 200px auto 100px; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>grid-template-areas<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0433\u043e \u044f\u0447\u0435\u0439\u043a\u043e\u0439 \u0413\u0440\u0438\u0434\u0430 (grid cell), \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0438 \u0441\u0442\u0440\u043e\u043a, \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oe\/2t\/sq\/oe2tsqvcz5om2ugqr7ircte3afg.png\">  <\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u043e\u0439 \u043c\u0430\u043a\u0435\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zh\/n7\/nh\/zhn7nhil9uwxo9m_utoozndbwww.png\">  <\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435, \u043d\u043e \u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>grid-template-areas<\/code>: \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0435\u0435 \u0441\u0445\u0435\u043c\u0443<\/li>\n<li><code>grid-area<\/code>: \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0445\u0435\u043c\u0443<\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0445\u0435\u043c\u0443<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 20px;   height: 100vh;    \/* ! *\/   grid-template-areas:     &quot;A A A A   A A A A   A A A A&quot;     &quot;B B B B   B B B B   B B C C&quot;     &quot;B B B B   B B B B   B B C C&quot;; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0445\u0435\u043c\u0443<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {   grid-area: A; } .box-2 {   grid-area: B; } .box-3 {   grid-area: C; }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>: \u043c\u044b \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>grid-area<\/code>, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445.<\/p>\n<p>  <\/p>\n<p><strong>column-gap<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u0442\u0443\u043f\u0430 \u043c\u0435\u0436\u0434\u0443 <strong>\u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438<\/strong>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_j\/ox\/uj\/_joxujzu6b6lhl5jemwnlwzt3gm.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   height: 100vh;   grid-template-columns: 100px 100px 100px;    \/* ! *\/   column-gap:  50px; }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>: \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>column-gap<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>grid-template-columns<\/code>.<\/p>\n<p>  <\/p>\n<p><strong>row-gap<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 <strong>\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438<\/strong>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wr\/n_\/nc\/wrn_nc60rfccnhtkvp0bv9ypp4a.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   height: 100vh;   grid-template-rows: 100px 100px 100px;    \/* ! *\/   row-gap:  50px; }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>: \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>row-gap<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>grid-template-rows<\/code>.<\/p>\n<p>  <\/p>\n<p><strong><code>justify-items<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0438\u0434-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0438\u0434-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0434\u043e\u043b\u044c <strong>\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043e\u0441\u0438<\/strong>. \u041e\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <strong>4<\/strong> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mn\/14\/lh\/mn14lhsemuerwhv5ufspksguo-w.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nd\/xo\/ot\/ndxootxpyhor_mmrtihi0vpyaca.png\">  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432 <code>HTML<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;container&quot;&gt;    &lt;!-- \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b A, B, C --&gt;    &lt;div class=&quot;box-4&quot;&gt; D &lt;\/div&gt; &lt;\/div<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c <code>CSS<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 50px;   height: 100vh;    \/* \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 200px \u043d\u0430 200px *\/   grid-template-rows: 200px 200px;   grid-template-columns: 200px 200px;    \/* ! *\/   justify-items : end; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>align-items<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0438\u0434-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0438\u0434-\u043a\u043e\u043d\u0442\u0435\u0439\u0435\u0440\u0430 \u0432\u0434\u043e\u043b\u044c <strong>\u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0439 \u043e\u0441\u0438<\/strong>. \u041e\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <strong>4<\/strong> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kj\/_l\/9y\/kj_l9yqgmjnr4mqdbzlt9sp-ram.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 50px;   height: 100vh;   grid-template-rows: 200px 200px;   grid-template-columns: 200px 200px;    \/* ! *\/   align-items: center; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>justify-content<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u0440\u0438\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0438\u0434-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0434\u043e\u043b\u044c <strong>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0441\u0438<\/strong>. \u041e\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <strong>7<\/strong> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gd\/6t\/u3\/gd6tu3sikftemt02zsjflgf6g_e.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/aa\/z4\/rm\/aaz4rmm4dwozyozerk0hoedpnhq.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 50px;   height: 100vh;   grid-template-rows: 200px 200px;   grid-template-columns: 200px 200px;    \/* ! *\/   justify-content: center; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>align-content<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u0440\u0438\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0438\u0434-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0434\u043e\u043b\u044c <strong>\u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0439 \u043e\u0441\u0438<\/strong>. \u041e\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <strong>7<\/strong> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bx\/9x\/nj\/bx9xnj5eqikqydu9jft297-1vke.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yt\/g0\/zx\/ytg0zxrfboxvlpgvw9ylecfed0a.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 50px;   height: 100vh;   grid-template-rows: 200px 200px;   grid-template-columns: 200px 200px;    \/* ! *\/   align-content : center; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"svoystva-grid-elementov\">\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u0440\u0438\u0434-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ie\/g2\/zg\/ieg2zgfnziqg3p8p_6vnoqhiuke.png\">  <\/p>\n<p><strong>\u0428\u043a\u0430\u043b\u0430 CSS Grid<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0448\u043a\u0430\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u043f\u0440\u0438 \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u0435\u0434\u0438\u043d\u0438\u0446:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 (1, 2, 3 \u0438 \u0442.\u0434.)<\/li>\n<li>\u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>span<\/code><\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ju\/ty\/fy\/jutyfyjxjyaarvls9af108ngtl4.png\">  <\/p>\n<p>\u041d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043d\u0438\u0436\u0435 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0441\u0442\u0440\u043e\u043a \u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 \u043e\u0434\u043d\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gf\/x1\/oq\/gfx1oq3dxrz1tmb6egw4tbkm41a.png\">  <\/p>\n<p><code>index.html<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;container&quot;&gt;   &lt;div class=&quot;box-1&quot;&gt; A &lt;\/div&gt;   &lt;div class=&quot;box-2&quot;&gt; B &lt;\/div&gt;   &lt;div class=&quot;box-3&quot;&gt; C &lt;\/div&gt;   &lt;div class=&quot;box-4&quot;&gt; D &lt;\/div&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>repeat()<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443\/\u0432\u044b\u0441\u043e\u0442\u0443 \u0434\u043b\u044f \u043a\u043e\u043b\u043e\u043d\u043e\u043a\/\u0441\u0442\u0440\u043e\u043a. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">grid-template-columns : repeat(4, 1fr);<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">grid-template-columns : 1fr 1fr 1fr 1fr;<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430<\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zf\/g8\/7z\/zfg87zmdf3itpgtmyejhbaprv4w.png\">  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f <code>fr<\/code>, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">grid-template-columns : repeat(4, 1fr);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 4 \u0440\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0432\u0435\u0441\u0435\u043b\u0438\u0442\u044c\u0441\u044f!<\/p>\n<p>  <\/p>\n<p><strong><code>grid-columns: start\/end<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c <strong>\u043a\u043e\u043b\u043e\u043d\u043a\u0438<\/strong>. \u041e\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>grid-column-start<\/code><\/li>\n<li><code>grid-column-end<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 20px;   height: 100vh;    grid-template-columns: repeat(12, 1fr);   grid-template-rows: repeat(12, 1fr); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ox\/dq\/o1\/oxdqo1k0bcqiqotrjavrxcdfqgy.png\">  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430 12 \u0440\u0430\u0432\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043a\u0430\u043a \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435, \u0442\u0430\u043a \u0438 \u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435. 1 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0447\u0430\u0441\u0442\u044c \u0438\u043b\u0438 \u0444\u0440\u0430\u043a\u0446\u0438\u044e. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 8 \u0444\u0440\u0430\u043a\u0446\u0438\u0439 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0435\u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u0441\u0442\u0438\u043b\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {} .box-2 {} .box-3 {} .box-4 {}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0448\u043a\u0430\u043b\u0435. \u041c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 \u2014 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ju\/ty\/fy\/jutyfyjxjyaarvls9af108ngtl4.png\">  <\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>.box-*<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0441\u0448\u0442\u0430\u0431 (scale):<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">grid-column-start: 1; grid-column-end: 2;  \/* \u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 *\/ grid-column: 1 \/ 2<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <code>span<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">grid-column : span 1;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 &quot;\u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043c&quot; 8 \u0444\u0440\u0430\u043a\u0446\u0438\u0439 <code>.box-1<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {   grid-column: 1 \/ 10 }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ak\/ag\/63\/akag63vsfpawgmpfrqb_8k_-xhq.png\">  <\/p>\n<p><strong>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f? <code>box-1<\/code> \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0447\u0430\u0441\u0442\u044c. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043a \u043d\u0435\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0449\u0435 8 \u0447\u0430\u0441\u0442\u0435\u0439. \u0418 \u0435\u0449\u0435 1 \u0432 \u043a\u043e\u043d\u0446\u0435. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f: 8 + 1 + 1 = 10.<\/p>\n<p>  <\/p>\n<p><strong>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>span<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>span<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a <code>box-1<\/code> 8 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {   grid-column: span 9; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0434\u0430\u0441\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  <\/p>\n<p><strong><code>grid-row: start\/end<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c <strong>\u0441\u0442\u0440\u043e\u043a\u0438<\/strong>. \u041e\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>grid-row-start<\/code><\/li>\n<li><code>grid-row-end<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430\u0445:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ju\/ty\/fy\/jutyfyjxjyaarvls9af108ngtl4.png\">  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a <code>box-1<\/code> 9 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {   grid-row : 1 \/ 11; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0447\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: <code>box-1<\/code> \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0447\u0430\u0441\u0442\u044c + 9 \u0447\u0430\u0441\u0442\u0435\u0439 + 1 \u0447\u0430\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0446\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 9 + 1 + 1 = 11.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e <code>span<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {   grid-row: span 10; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/za\/lo\/vh\/zalovhiu_zxc_xdcx9wtawdbpua.png\">  <\/p>\n<p><strong><code>grid-area<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <code>grid-temlate-areas<\/code>, \u043e \u0447\u0435\u043c \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0432\u044b\u0448\u0435. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b9\/o2\/al\/b9o2alasfis91perxz30kmo4h8c.png\">  <\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c <code>grid-template-areas<\/code> \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/et\/26\/zc\/et26zc6lw-jjsxt9mxzwzh06w6a.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap: 20px;   height: 100vh;    grid-template-areas:     &quot;A A A A   A A A A   A A A A&quot;     &quot;B B B B   B B B B   B B C C&quot;     &quot;B B B B   B B B B   B B C C&quot;; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c <code>grid-area<\/code> \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/br\/yx\/tc\/bryxtcvieilxvcnvdqf8_yzq9ck.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.box-1 {   grid-area: A; } .box-2 {   grid-area: B; } .box-3 {   grid-area: C; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>justify-self<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <strong>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e<\/strong> \u0433\u0440\u0438\u0434-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u0434\u043e\u043b\u044c <strong>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0441\u0438<\/strong>. \u041e\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <strong>4<\/strong> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l-\/sz\/yc\/l-szycbarhvfjzilermxpg-ozig.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap :25px;   height: 100vh;   grid-template-rows: 1fr 1fr;   grid-template-columns: 1fr 1fr; }  .box-1 {   \/* ! *\/   justify-self : start; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>align-self<\/code><\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <strong>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e<\/strong> \u0433\u0440\u0438\u0434-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u0434\u043e\u043b\u044c <strong>\u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0439 \u043e\u0441\u0438<\/strong>. \u041e\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <strong>4<\/strong> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p_\/4w\/8m\/p_4w8mk7u_i3gp6_t4l0isnmuzw.png\">  <\/p>\n<p><code>style.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.container {   display: grid;   gap :25px;   height: 100vh;   grid-template-rows: 1fr 1fr;   grid-template-columns: 1fr 1fr; } .box-1 {   \/* ! *\/   align-self : start; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"sokrascheniya-dlya-svoystv-css-grid\">\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 <code>CSS Grid<\/code><\/h2>\n<p>  <\/p>\n<ul>\n<li><code>place-content<\/code><\/li>\n<li><code>place-items<\/code><\/li>\n<li><code>place-self<\/code><\/li>\n<li><code>grid-template<\/code><\/li>\n<li><code>gap<\/code> \/ <code>grid-gap<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong><code>place-content<\/code><\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y6\/or\/om\/y6orom2os168zrzi1lmwklvuxf0.png\">  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>align-content<\/code><\/li>\n<li><code>justify-content<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">align-content: center; justify-content: end;  \/* ! *\/ place-content: center \/ end;<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>place-items<\/code><\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jj\/fb\/ed\/jjfbedbc1xlysqx_a_d9g0y4ddw.png\">  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>align-items<\/code><\/li>\n<li><code>justify-items<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">align-items: end; justify-items: center;  \/* ! *\/ place-items: end \/ center;<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>place-self<\/code><\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/av\/fx\/8e\/avfx8egtvzkqqgp-ba04aohgkpe.png\">  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>align-self<\/code><\/li>\n<li><code>justify-self<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">align-self: start; justify-self: end;  \/* ! *\/ place-self: start \/ end;<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>grid-template<\/code><\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qf\/sp\/ys\/qfspysczcgxxnl7dbfn3fcawg3c.png\">  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>grid-template-rows<\/code><\/li>\n<li><code>grid-template-columns<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">grid-template-rows: 100px 100px; grid-template-columns: 200px 200px;  \/* ! *\/ grid-template: 100px 100px \/ 200px 200px;<\/code><\/pre>\n<p>  <\/p>\n<p><strong><code>gap\/grid-gap<\/code><\/strong><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zi\/-7\/lv\/zi-7lv9qrnvlodlwzi2qwhpe8ow.png\">  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>row-gap<\/code><\/li>\n<li><code>columns-gap<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">row-gap: 20px ; column-gap: 30px ;  \/* ! *\/ gap: 20px  30px;<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0432\u0430\u0448\u0438\u0445 \u0440\u0443\u043a\u0430\u0445 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446.<\/p>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p><a href=\"https:\/\/macloud.ru\/cloud-vps\">VPS-\u0445\u043e\u0441\u0442\u0438\u043d\u0433<\/a> \u0441 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 NVM\u0435-\u0434\u0438\u0441\u043a\u0430\u043c\u0438 \u0438 \u043f\u043e\u0441\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u043e\u043f\u043b\u0430\u0442\u043e\u0439. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0432\u043e\u0435\u0433\u043e ISO.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/macloud.ru\/vps-vds&amp;utm_source=habr&amp;utm_medium=perevod&amp;utm_campaign=grigri\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gj\/zs\/hm\/gjzshmojh-bmnbzvfsre9se1eta.png\"><\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/macloud\/blog\/564182\/\"> https:\/\/habr.com\/ru\/company\/macloud\/blog\/564182\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ii\/wm\/o4\/iiwmo4xd5llqegxpezthtndpepq.png\">  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>CSS Grid<\/code> (\u0434\u0430\u043b\u0435\u0435 \u0442\u0430\u043a\u0436\u0435 \u2014 \u0413\u0440\u0438\u0434), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0435 \u0438\u043b\u0438 \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u0435 \u043c\u0430\u043a\u0435\u0442\u044b \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0440\u0430\u0442\u043a\u043e, \u043d\u043e \u043f\u043e\u043b\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<p>  <\/p>\n<h2 id=\"chto-takoe-css-grid\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>CSS Grid<\/code>?<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/-h\/7z\/mx-h7zjpr1fuvcrok8mqkktk5lk.png\">  <\/p>\n<p>\u0413\u0440\u0438\u0434 \u2014 \u044d\u0442\u043e \u043c\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 (\u0435\u0433\u043e \u0441\u0445\u0435\u043c\u0430, \u043f\u0440\u043e\u0435\u043a\u0442).<\/p>\n<p>  <\/p>\n<p>\u0413\u0440\u0438\u0434-\u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0430\u0439\u0442\u0430 (\u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c). \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0430\u0439\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u043a\u0435\u0442\u0430 \u0441\u0430\u0439\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0413\u0440\u0438\u0434\u0430.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-325427","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=325427"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325427\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}