{"id":359697,"date":"2024-05-21T00:38:05","date_gmt":"2024-05-21T00:38:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=359697"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=359697","title":{"rendered":"<span>\u041a\u0430\u043a \u0432\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440? \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 css grid<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f \u043d\u0430 \u0434\u043d\u044f\u0445 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0449\u044c. \u0425\u043e\u0442\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 css grid \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0433\u043e\u0434, \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0442\u043e \u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u043e \u043d\u0435\u043c, \u0442\u043e \u043b\u0438 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d. \u042f \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u043e \u0432\u0438\u0436\u0443 \u0435\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 grid. \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0431\u0443\u0434\u044c \u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442 \u0438\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 (\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0431\u043b\u043e\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0442\u043a\u0443 (\u043a\u043e\u0433\u0434\u0430 \u0435\u0435 \u0443\u0436\u0435 \u043f\u043e\u043c\u0435\u0442\u044f\u0442 \u043a\u0430\u043a obsolete?)), \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c flex). \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0432\u0435\u0440\u0445\u043d\u0438\u043c \u0438 \u043d\u0438\u0436\u043d\u0438\u043c \u0442\u0443\u043b\u0431\u0430\u0440\u043e\u043c, \u0438 \u0446\u0435\u043d\u0442\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"css\">&lt;style>       .root {         width: 100%;         height: 100%;         background-color: yellow;               }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }     &lt;\/style>     &lt;div class=\"root\">       &lt;div class=\"toolbar1\">         &lt;button>button1&lt;\/button>       &lt;\/div>       &lt;div class=\"main\">         &lt;div class=\"main-big-content\">         &lt;\/div>       &lt;\/div>       &lt;div class=\"toolbar2\">         &lt;button>button1&lt;\/button>       &lt;\/div>     &lt;\/div><\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b5\/7ae\/7f5\/8b57ae7f5bd818f96b41c58e88394517.png\" width=\"751\" height=\"674\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b5\/7ae\/7f5\/8b57ae7f5bd818f96b41c58e88394517.png\"\/><\/figure>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e! \u041d\u0438\u0436\u043d\u0438\u0439 \u0442\u0443\u043b\u0431\u0430\u0440 \u043d\u0435 \u0432\u0438\u0434\u0435\u043d. \u041d\u0443 \u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u0438\u043c overflow \u043a \u0446\u0435\u043d\u0442\u0440\u0443:<\/p>\n<pre><code class=\"css\">.main {         background-color: grey;         overflow: auto,       }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0b4\/2a1\/e8a\/0b42a1e8a27c80d6a354725bd2c291b8.png\" width=\"754\" height=\"631\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b4\/2a1\/e8a\/0b42a1e8a27c80d6a354725bd2c291b8.png\"\/><\/figure>\n<p>\u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0427\u0442\u043e \u0436, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c flex. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 flex-direction: column, flex: 1 \u0438 \u0442. \u0434.:<\/p>\n<pre><code class=\"css\">      .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/771\/56a\/500\/77156a5002401f5a701c206dc979b7e8.png\" width=\"770\" height=\"651\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/771\/56a\/500\/77156a5002401f5a701c206dc979b7e8.png\"\/><\/figure>\n<p>\u0414\u0430 \u0447\u0442\u043e \u0437\u0430 \u0435\u0440\u0443\u043d\u0434\u0430? \u0410, \u043d\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e. Body \u0442\u043e\u0436\u0435 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u0441\u044f. \u041b\u0430\u0434\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"css\">html,body {   height: 100%;   padding: 0px;   margin: 0px; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6d9\/96f\/2af\/6d996f2af828cf712b64976d32c90432.png\" width=\"755\" height=\"656\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d9\/96f\/2af\/6d996f2af828cf712b64976d32c90432.png\"\/><\/figure>\n<p>\u0414\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434 \u0441\u0442\u0430\u043b, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0431\u043b\u043e\u043a\u0438, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 display: flex, flex-direction: column \u0438 flex: 1, \u0432\u0441\u0435 \u0440\u0430\u0437\u044a\u0435\u0434\u0435\u0442\u0441\u044f! \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0438\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e-\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         height: 100%;         background-color: yellow;            display: grid;         grid-template-rows: min-content auto min-content       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2ef\/131\/cd5\/2ef131cd56cd3bbb426603e27a943a95.png\" width=\"760\" height=\"671\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ef\/131\/cd5\/2ef131cd56cd3bbb426603e27a943a95.png\"\/><\/figure>\n<p>\u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u042f \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0431\u0435\u0434\u0438\u043b? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443. \u0418 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f flex-\u043e\u043c:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }     &lt;\/style>     &lt;div class=\"root\">       &lt;div class=\"toolbar1\">         &lt;button>button1&lt;\/button>       &lt;\/div>       &lt;div class=\"main\">           &lt;div class=\"main-2\">             &lt;div class=\"toolbar2-1\">                &lt;button>button2-1&lt;\/button>             &lt;\/div>             &lt;div class=\"main-big-content\">             &lt;\/div>             &lt;div class=\"toolbar2-2\">                 &lt;button>button2-2&lt;\/button>             &lt;\/div>         &lt;\/div>       &lt;\/div>       &lt;div class=\"toolbar2\">         &lt;button>button1&lt;\/button>       &lt;\/div>     &lt;\/div><\/code><\/pre>\n<p>\u0421\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/583\/865\/4de\/5838654de066bec199298db65ead945d.png\" width=\"764\" height=\"664\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/583\/865\/4de\/5838654de066bec199298db65ead945d.png\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u043f\u044f\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0447\u0443 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e \u0444\u043b\u0435\u043a\u0441\u044b&#8230;<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         flex: 1;         display: flex;         flex-direction: column;         overflow: hidden;       }       .main-2 {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5c9\/2f4\/303\/5c92f4303e05db3f231d7720d979f3e3.png\" width=\"773\" height=\"659\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c9\/2f4\/303\/5c92f4303e05db3f231d7720d979f3e3.png\"\/><\/figure>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u0430\u043a\u043e\u0439 \u0446\u0435\u043d\u043e\u0439!<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043d\u0430 grid:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: grid;         grid-template-rows: min-content auto min-content;       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         display: grid;         grid-template-rows: min-content auto min-content;         overflow: hidden;       }       .main-2 {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435! \u0410 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/16b\/d6d\/e32\/16bd6de3297f1f747ad4753c8af8c8d3.png\" width=\"755\" height=\"658\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/16b\/d6d\/e32\/16bd6de3297f1f747ad4753c8af8c8d3.png\"\/><\/figure>\n<p>\u0410 \u0437\u043d\u0430\u0435\u0442\u0435 \u0432 \u0447\u0435\u043c \u043f\u0440\u0438\u043a\u043e\u043b? grid-template-rows \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0443\u043c\u043d\u044b\u0439, \u043e\u043d \u0441\u0430\u043c \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: grid;       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         display: grid;         overflow: hidden;       }       .main-2 {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c0c\/03f\/5ce\/c0c03f5cece586f9b9912599ee137b4b.png\" width=\"768\" height=\"678\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c0c\/03f\/5ce\/c0c03f5cece586f9b9912599ee137b4b.png\"\/><\/figure>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>\u0418 \u0434\u0430, \u0432\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u0435\u043d\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435: &#171;\u0410 \u0437\u0430\u0447\u0435\u043c \u0442\u0435\u0431\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430 grid-\u044b? \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043e\u0434\u043d\u0438\u043c?&#187;. \u0418 \u043e\u0442\u0432\u0435\u0442: \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u041d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u0430. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0438 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043e\u0434\u043d\u0438\u043c grid-\u043e\u043c:<\/p>\n<pre><code class=\"css\">&lt;style>       html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: grid;         overflow: hidden;       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }     &lt;\/style>     &lt;div class=\"root\">       &lt;div class=\"toolbar1\">         &lt;button>button1&lt;\/button>       &lt;\/div>       &lt;div class=\"toolbar2-1\">         &lt;button>button2-1&lt;\/button>       &lt;\/div>       &lt;div class=\"main\">         &lt;div class=\"main-big-content\">         &lt;\/div>       &lt;\/div>       &lt;div class=\"toolbar2-2\">         &lt;button>button2-2&lt;\/button>       &lt;\/div>       &lt;div class=\"toolbar2\">         &lt;button>button1&lt;\/button>       &lt;\/div>     &lt;\/div><\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/03e\/e9c\/8bb\/03ee9c8bb10e8c1524367a30f8a50a42.png\" width=\"774\" height=\"664\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/03e\/e9c\/8bb\/03ee9c8bb10e8c1524367a30f8a50a42.png\"\/><\/figure>\n<p>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041d\u0430\u0447\u0438\u043d\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c grid-\u044b!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/772834\/\"> https:\/\/habr.com\/ru\/articles\/772834\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f \u043d\u0430 \u0434\u043d\u044f\u0445 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0449\u044c. \u0425\u043e\u0442\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 css grid \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0433\u043e\u0434, \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0442\u043e \u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u043e \u043d\u0435\u043c, \u0442\u043e \u043b\u0438 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d. \u042f \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u043e \u0432\u0438\u0436\u0443 \u0435\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 grid. \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0431\u0443\u0434\u044c \u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442 \u0438\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 (\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0431\u043b\u043e\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0442\u043a\u0443 (\u043a\u043e\u0433\u0434\u0430 \u0435\u0435 \u0443\u0436\u0435 \u043f\u043e\u043c\u0435\u0442\u044f\u0442 \u043a\u0430\u043a obsolete?)), \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c flex). \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0432\u0435\u0440\u0445\u043d\u0438\u043c \u0438 \u043d\u0438\u0436\u043d\u0438\u043c \u0442\u0443\u043b\u0431\u0430\u0440\u043e\u043c, \u0438 \u0446\u0435\u043d\u0442\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"css\">&lt;style>       .root {         width: 100%;         height: 100%;         background-color: yellow;               }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }     &lt;\/style>     &lt;div class=\"root\">       &lt;div class=\"toolbar1\">         &lt;button>button1&lt;\/button>       &lt;\/div>       &lt;div class=\"main\">         &lt;div class=\"main-big-content\">         &lt;\/div>       &lt;\/div>       &lt;div class=\"toolbar2\">         &lt;button>button1&lt;\/button>       &lt;\/div>     &lt;\/div><\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e! \u041d\u0438\u0436\u043d\u0438\u0439 \u0442\u0443\u043b\u0431\u0430\u0440 \u043d\u0435 \u0432\u0438\u0434\u0435\u043d. \u041d\u0443 \u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u0438\u043c overflow \u043a \u0446\u0435\u043d\u0442\u0440\u0443:<\/p>\n<pre><code class=\"css\">.main {         background-color: grey;         overflow: auto,       }<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0427\u0442\u043e \u0436, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c flex. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 flex-direction: column, flex: 1 \u0438 \u0442. \u0434.:<\/p>\n<pre><code class=\"css\">      .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430 \u0447\u0442\u043e \u0437\u0430 \u0435\u0440\u0443\u043d\u0434\u0430? \u0410, \u043d\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e. Body \u0442\u043e\u0436\u0435 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u0441\u044f. \u041b\u0430\u0434\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"css\">html,body {   height: 100%;   padding: 0px;   margin: 0px; }<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434 \u0441\u0442\u0430\u043b, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0431\u043b\u043e\u043a\u0438, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 display: flex, flex-direction: column \u0438 flex: 1, \u0432\u0441\u0435 \u0440\u0430\u0437\u044a\u0435\u0434\u0435\u0442\u0441\u044f! \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0438\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e-\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         height: 100%;         background-color: yellow;            display: grid;         grid-template-rows: min-content auto min-content       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u042f \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0431\u0435\u0434\u0438\u043b? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443. \u0418 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f flex-\u043e\u043c:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2 {         background-color: cyan;       }     &lt;\/style>     &lt;div class=\"root\">       &lt;div class=\"toolbar1\">         &lt;button>button1&lt;\/button>       &lt;\/div>       &lt;div class=\"main\">           &lt;div class=\"main-2\">             &lt;div class=\"toolbar2-1\">                &lt;button>button2-1&lt;\/button>             &lt;\/div>             &lt;div class=\"main-big-content\">             &lt;\/div>             &lt;div class=\"toolbar2-2\">                 &lt;button>button2-2&lt;\/button>             &lt;\/div>         &lt;\/div>       &lt;\/div>       &lt;div class=\"toolbar2\">         &lt;button>button1&lt;\/button>       &lt;\/div>     &lt;\/div><\/code><\/pre>\n<p>\u0421\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u043f\u044f\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0447\u0443 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e \u0444\u043b\u0435\u043a\u0441\u044b&#8230;<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: flex;         flex-direction: column       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         flex: 1;         display: flex;         flex-direction: column;         overflow: hidden;       }       .main-2 {         background-color: grey;         overflow: auto;         flex: 1;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u0430\u043a\u043e\u0439 \u0446\u0435\u043d\u043e\u0439!<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043d\u0430 grid:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: grid;         grid-template-rows: min-content auto min-content;       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         display: grid;         grid-template-rows: min-content auto min-content;         overflow: hidden;       }       .main-2 {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435! \u0410 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0410 \u0437\u043d\u0430\u0435\u0442\u0435 \u0432 \u0447\u0435\u043c \u043f\u0440\u0438\u043a\u043e\u043b? grid-template-rows \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0443\u043c\u043d\u044b\u0439, \u043e\u043d \u0441\u0430\u043c \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"css\">html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: grid;       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         display: grid;         overflow: hidden;       }       .main-2 {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>\u0418 \u0434\u0430, \u0432\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u0435\u043d\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435: &#171;\u0410 \u0437\u0430\u0447\u0435\u043c \u0442\u0435\u0431\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430 grid-\u044b? \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043e\u0434\u043d\u0438\u043c?&#187;. \u0418 \u043e\u0442\u0432\u0435\u0442: \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u041d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u0430. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0438 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043e\u0434\u043d\u0438\u043c grid-\u043e\u043c:<\/p>\n<pre><code class=\"css\">&lt;style>       html, body {         height: 100%;         padding: 0px;         margin: 0px;       }       .root {         width: 100%;         height: 100%;         background-color: yellow;            display: grid;         overflow: hidden;       }       .toolbar1, .toolbar2-1 {         background-color: green;       }       .main {         background-color: grey;         overflow: auto;       }       .main-big-content {         background-color: black;         height: 2000px;       }       .toolbar2, .toolbar2-2 {         background-color: cyan;       }     &lt;\/style>     &lt;div class=\"root\">       &lt;div class=\"toolbar1\">         &lt;button>button1&lt;\/button>       &lt;\/div>       &lt;div class=\"toolbar2-1\">         &lt;button>button2-1&lt;\/button>       &lt;\/div>       &lt;div class=\"main\">         &lt;div class=\"main-big-content\">         &lt;\/div>       &lt;\/div>       &lt;div class=\"toolbar2-2\">         &lt;button>button2-2&lt;\/button>       &lt;\/div>       &lt;div class=\"toolbar2\">         &lt;button>button1&lt;\/button>       &lt;\/div>     &lt;\/div><\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041d\u0430\u0447\u0438\u043d\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c grid-\u044b!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/772834\/\"> https:\/\/habr.com\/ru\/articles\/772834\/<\/a><br \/><\/br><\/br><\/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-359697","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359697","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=359697"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359697\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}