{"id":308036,"date":"2020-08-05T15:01:13","date_gmt":"2020-08-05T15:01:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308036"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308036","title":{"rendered":"CSS Grid \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/513902\/\">\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Grid?<\/h4>\n<p>  Grid \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u043d\u0438\u0439 \u2014 \u043e\u0434\u0438\u043d \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0446\u044b, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u044b \u0432 \u0441\u0435\u0442\u043a\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c. <\/p>\n<h4>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438<\/h4>\n<p>  <b>\u0412 2020 \u0433\u043e\u0434\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 94 %<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_q\/1j\/w3\/_q1jw3vjsqqt1cp4bmysqdav3vi.png\"><\/p>\n<h4>Grid \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/h4>\n<p>  \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c <i>grid \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/i>, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f <b>display: grid<\/b> \u0438\u043b\u0438 <b>display: inline-grid<\/b> \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u0432\u0441\u0435 <i>\u043f\u0440\u044f\u043c\u044b\u0435 \u0434\u0435\u0442\u0438<\/i> \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u043d\u0443\u0442 <i>\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0435\u0442\u043a\u0438<\/i>.<\/p>\n<pre><code class=\"javascript\">&lt;body&gt;  &lt;div class=&quot;row&quot;&gt;   &lt;div class=&quot;row__item header&quot;&gt;    &lt;h1&gt;Header&lt;\/h1&gt;   &lt;\/div&gt;   &lt;div class=&quot;row__item nav&quot;&gt;    &lt;h1&gt;Navbar&lt;\/h1&gt;   &lt;\/div&gt;   &lt;div class=&quot;row__item article&quot;&gt;    &lt;h1&gt;Article&lt;\/h1&gt;   &lt;\/div&gt;   &lt;div class=&quot;row__item ads&quot;&gt;    &lt;h1&gt;Ads&lt;\/h1&gt;   &lt;\/div&gt;  &lt;\/div&gt; &lt;\/body&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">.row {  display: grid;  margin: auto;  grid-template-rows: 60px 1fr ;  grid-template-columns: 20% 1fr 15%;  grid-gap: 10px;  width: 1000px;  height: 1000px;  justify-items: center;  justify-content: space-between;  grid-template-areas:  &quot;header header header&quot;  &quot;nav article ads&quot;;  }<\/code><\/pre>\n<p>  grid-template-rows \u2014 \u044d\u0442\u043e CSS \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0439 \u0438 \u043f\u0443\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 grid rows.<\/p>\n<p>  CSS \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>grid-row<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u0441\u0435\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0438\u043b\u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u0441\u0435\u0442\u043a\u0438. \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 <a href=\"https:\/\/xsltdev.ru\/css\/grid-row-start\/\" rel=\"nofollow\">grid-row-start<\/a> \u0438 <a href=\"https:\/\/xsltdev.ru\/css\/grid-row-end\/\" rel=\"nofollow\">grid-row-end<\/a>.<\/p>\n<p>  \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e CSS <code>grid-gap<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0434\u043b\u044f <code>grid-row-gap<\/code> \u0438 <code>grid-column-gap<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0436\u0435\u043b\u043e\u0431\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0441\u0435\u0442\u043a\u0438.<\/p>\n<p>  \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>grid-template-areas<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u0435\u0442\u043a\u0438 \u0441\u0441\u044b\u043b\u0430\u044f\u0441\u044c \u043d\u0430 \u0438\u043c\u0435\u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <a href=\"https:\/\/xsltdev.ru\/css\/grid-area\/\" rel=\"nofollow\">grid-area<\/a>.<\/p>\n<p>  \u041f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u0438 \u044f\u0447\u0435\u0439\u043a\u0438. \u0422\u043e\u0447\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443. \u0421\u0430\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0435\u0442\u043a\u0438.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>grid-area<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f. \u0418\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u043a\u0435\u0442\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u043d\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<a name=\"habracut\"><\/a><\/p>\n<pre><code class=\"javascript\">.header{ grid-area: header; } .nav{ grid-area: nav; } .article{ grid-area: article; } .ads{ grid-area: ads; }<\/code><\/pre>\n<p>  <\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u0430\u0439\u0442\u0430 \u0441 CSS Grid:<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xq\/w3\/bn\/xqw3bnwnr0jb6sirov2u6ynoza8.png\"><\/p>\n<h4>\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d<\/h4>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u0433\u0440\u0438\u0434-\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 <code>grid-template-areas<\/code>.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u0435\u043d\u0438\u043c \u043d\u0430 \u044d\u0442\u043e:<\/p>\n<pre><code class=\"javascript\">grid-template-areas:  &quot;nav header header&quot;  &quot;nav article ads&quot;;  } <\/code><\/pre>\n<p>  \u0422\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ss\/p2\/5v\/ssp25vzll-fexcc8ue1bkf3eibe.png\"><\/p>\n<h4>\u0413\u0440\u0438\u0434\u044b \u0441 \u043c\u0435\u0434\u0438\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438<\/h4>\n<p>  \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u0433\u0440\u0438\u0434\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<p>  \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 CSS Grid \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <i>ASCII-\u0433\u0440\u0430\u0444\u0438\u043a\u0435<\/i> \u0438 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043c\u0435\u0434\u0438\u0430 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<pre><code class=\"javascript\">@media all and (max-width: 575px) { .row { grid-template-areas: &quot;header&quot; &quot;article&quot; &quot;ads&quot; &quot;nav&quot;; grid-template-rows: 80px 1fr 70px 1fr ; grid-template-columns: 1fr; } } <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cs\/qg\/hk\/csqghkpwd5i48g54jtping8wcki.png\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0441\u0435 \u0434\u0435\u043b\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 <code>grid-template-areas<\/code>.<\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432\u0435\u0440\u0445\u0443\u0448\u043a\u0443 CSS Grid Layout \u0430\u0439\u0441\u0431\u0435\u0440\u0433\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0433\u043b\u0430\u0437\u0430\u043c \u043a\u0430\u043a\u0438\u0435 \u0448\u0442\u0443\u043a\u0438 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 CSS Grid. \u042d\u0442\u043e \u0440\u0430\u0437\u0440\u044b\u0432 \u0432\u0441\u0435\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. \u0418 \u043c\u043d\u0435 \u044d\u0442\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u042f \u0432\u0430\u043c \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0435\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435. \u041f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0432\u0430\u043c \u044d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u043f\u0438\u0448\u0435\u0442\u0435 \u0432\u044b \u043d\u0430 React, Angular, Vue (\u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0435). Grid\u2019\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043d\u0430\u0434\u043e\u043b\u0433\u043e.<\/p><\/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\/post\/513902\/\"> https:\/\/habr.com\/ru\/post\/513902\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/513902\/\">\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Grid?<\/h4>\n<p>  Grid \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u043d\u0438\u0439 \u2014 \u043e\u0434\u0438\u043d \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0446\u044b, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u044b \u0432 \u0441\u0435\u0442\u043a\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c. <\/p>\n<h4>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438<\/h4>\n<p>  <b>\u0412 2020 \u0433\u043e\u0434\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 94 %<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_q\/1j\/w3\/_q1jw3vjsqqt1cp4bmysqdav3vi.png\"><\/p>\n<h4>Grid \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/h4>\n<p>  \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c <i>grid \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/i>, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f <b>display: grid<\/b> \u0438\u043b\u0438 <b>display: inline-grid<\/b> \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u0432\u0441\u0435 <i>\u043f\u0440\u044f\u043c\u044b\u0435 \u0434\u0435\u0442\u0438<\/i> \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u043d\u0443\u0442 <i>\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0435\u0442\u043a\u0438<\/i>.<\/p>\n<pre><code class=\"javascript\">&lt;body&gt;  &lt;div class=&quot;row&quot;&gt;   &lt;div class=&quot;row__item header&quot;&gt;    &lt;h1&gt;Header&lt;\/h1&gt;   &lt;\/div&gt;   &lt;div class=&quot;row__item nav&quot;&gt;    &lt;h1&gt;Navbar&lt;\/h1&gt;   &lt;\/div&gt;   &lt;div class=&quot;row__item article&quot;&gt;    &lt;h1&gt;Article&lt;\/h1&gt;   &lt;\/div&gt;   &lt;div class=&quot;row__item ads&quot;&gt;    &lt;h1&gt;Ads&lt;\/h1&gt;   &lt;\/div&gt;  &lt;\/div&gt; &lt;\/body&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">.row {  display: grid;  margin: auto;  grid-template-rows: 60px 1fr ;  grid-template-columns: 20% 1fr 15%;  grid-gap: 10px;  width: 1000px;  height: 1000px;  justify-items: center;  justify-content: space-between;  grid-template-areas:  &quot;header header header&quot;  &quot;nav article ads&quot;;  }<\/code><\/pre>\n<p>  grid-template-rows \u2014 \u044d\u0442\u043e CSS \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0439 \u0438 \u043f\u0443\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 grid rows.<\/p>\n<p>  CSS \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>grid-row<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u0441\u0435\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0438\u043b\u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u0441\u0435\u0442\u043a\u0438. \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 <a href=\"https:\/\/xsltdev.ru\/css\/grid-row-start\/\" rel=\"nofollow\">grid-row-start<\/a> \u0438 <a href=\"https:\/\/xsltdev.ru\/css\/grid-row-end\/\" rel=\"nofollow\">grid-row-end<\/a>.<\/p>\n<p>  \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e CSS <code>grid-gap<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0434\u043b\u044f <code>grid-row-gap<\/code> \u0438 <code>grid-column-gap<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0436\u0435\u043b\u043e\u0431\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0441\u0435\u0442\u043a\u0438.<\/p>\n<p>  \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>grid-template-areas<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u0435\u0442\u043a\u0438 \u0441\u0441\u044b\u043b\u0430\u044f\u0441\u044c \u043d\u0430 \u0438\u043c\u0435\u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <a href=\"https:\/\/xsltdev.ru\/css\/grid-area\/\" rel=\"nofollow\">grid-area<\/a>.<\/p>\n<p>  \u041f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u0438 \u044f\u0447\u0435\u0439\u043a\u0438. \u0422\u043e\u0447\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443. \u0421\u0430\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0435\u0442\u043a\u0438.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>grid-area<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f. \u0418\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u043a\u0435\u0442\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u043d\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/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-308036","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308036","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=308036"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308036\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}