{"id":320842,"date":"2021-04-05T03:00:10","date_gmt":"2021-04-05T03:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320842"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320842","title":{"rendered":"5 \u043f\u043b\u043e\u0445\u0438\u0445 CSS \u043f\u0440\u0430\u043a\u0442\u0438\u043a"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u0411\u044b\u0442\u0443\u0435\u0442 \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e CSS \u0441\u043b\u043e\u0436\u043d\u044b\u0439. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439, \u043c\u0430\u0433\u0438\u0438. \u041b\u0435\u0433\u043a\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043a\u043e\u043b\u0435\u043d\u043e. \u041c\u0435\u043d\u044f \u044d\u0442\u043e \u043f\u0435\u0447\u0430\u043b\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u0442\u0430\u043a \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0432, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044f \u0441\u043e\u0431\u0440\u0430\u043b 5 \u043f\u0440\u0438\u0432\u044b\u0447\u0435\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f, \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a \u0438\u0445 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c. <\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u044b, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0445<\/h2>\n<p>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e, \u0447\u0442\u043e \u043b\u044e\u0434\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u043e\u0442\u0441\u0442\u0443\u043f\u044b (margin \u0438\u043b\u0438 padding) \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442 \u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u0437\u0430\u0447\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043e\u0434\u043d\u0438\u043c. \u041f\u0440\u043e\u0449\u0435 \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432: nth-child\/nth-of-type \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b, \u043f\u0441\u0435\u0432\u0434\u043e-\u043a\u043b\u0430\u0441\u0441 :not(), \u0438\u043b\u0438 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0442\u043e\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043a\u0430\u043a +, \u0438 \u0432\u0430\u0448 CSS \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043a\u0440\u0430\u0442\u043a\u0438\u043c. <\/p>\n<p>  <\/p>\n<p><strong>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.item {   margin-right: 1rem; }  .item:last-child {   margin-right: 0; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.item:not(:last-child) {   margin-right: 1rem; } \/*\u0438\u043b\u0438*\/ .item:nth-child(n+2) {   margin-left: 1rem; } \/*\u0438\u043b\u0438*\/ .item + .item {   margin-left: 1rem; } <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c display: block \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 position: absolute \u0438\u043b\u0438 position: fixed<\/h2>\n<p>  <\/p>\n<p>\u0410 \u0437\u043d\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c display: block \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 c position: absolute \u0438\u043b\u0438 position: fixed, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e? <\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c inline-* \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: inline \u0438\u043b\u0438 inline-block \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f \u043d\u0430 block, inline-flex -&gt; flex, inline-grid -&gt; grid, \u0438 inline-table -&gt; table.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 position: absolute \u0438\u043b\u0438 position: fixed, \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 display, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f flex \u0438\u043b\u0438 grid.<\/p>\n<p>  <\/p>\n<p><strong>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.button::before {   content: &quot;&quot;;   display: block;   position: absolute; } \/*\u0438\u043b\u0438*\/ .button::before {   content: &quot;&quot;;   display: block;   position: fixed; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.button::before {   content: &quot;&quot;;   position: absolute; } \/*\u0438\u043b\u0438*\/ .button::before {   content: &quot;&quot;;   position: fixed; }<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c transform: translate(-50%, -50%) \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>C\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043f\u0438\u043b\u0430 \u043d\u0435 \u043c\u0430\u043b\u043e \u043a\u0440\u043e\u0432\u0438. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043e 2015 \u0433\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u0438 \u043a \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c. \u042f \u0433\u043e\u0432\u043e\u0440\u044e \u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u043e\u0439 \u043f\u043e \u0434\u0432\u0443\u043c \u043e\u0441\u044f\u043c. <\/p>\n<p>  <\/p>\n<p>\u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 transform. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a <a href=\"https:\/\/stackoverflow.com\/questions\/31109299\/css-transform-translate-50-50-makes-texts-blurry\" rel=\"nofollow noopener noreferrer\">\u0440\u0430\u0437\u043c\u044b\u0442\u0438\u044e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 Chromium \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f flexbox \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0435\u043c, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d. \u041c\u0430\u043b\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0430\u0437\u043c\u044b\u0442\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0440\u0435\u0448\u0435\u043d\u0430, \u0442\u0430\u043a \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 5 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0435\u043c\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u043a\u043e\u0434 \u0434\u043e 2 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c margin: auto \u0432\u043d\u0443\u0442\u0440\u0438 flex-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443. \u041f\u0440\u043e\u0441\u0442\u043e 2 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0432\u0441\u0435.<\/p>\n<p>  <\/p>\n<p><strong>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.parent {   position: relative; }  .child {   position: absolute;   top: 50%;   left: 50%;   transform: translate(-50%, -50%); }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.parent {   display: flex; }  .child {   margin: auto; }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c justify-content \u0438 align-items \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u044f \u043d\u0435 \u043b\u044e\u0431\u043b\u044e \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442. \u041e \u043d\u0438\u0445 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/em><\/p>\n<p>  <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c width: 100% \u0434\u043b\u044f \u0431\u043b\u043e\u0447\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c flexbox \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u043e\u043b\u043e\u043d\u043e\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u043b\u043e\u043d\u043a\u0443. <\/p>\n<p>  <\/p>\n<p>\u0418 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0442\u043a\u0443 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e width: 100%. \u042f \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442. \u0412\u0435\u0434\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0435\u0442\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u043b\u043e\u0447\u043d\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. <\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c width: 100%, \u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0434\u0438\u0430-\u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b flexbox \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u043e\u043b\u043e\u043d\u043e\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><strong>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;parent&quot;&gt;   &lt;div class=&quot;child&quot;&gt;1&lt;\/div&gt;   &lt;div class=&quot;child&quot;&gt;2&lt;\/div&gt;   &lt;div class=&quot;child&quot;&gt;3&lt;\/div&gt;   &lt;div class=&quot;child&quot;&gt;4&lt;\/div&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"css\">.parent {   display: flex;   flex-wrap: wrap; }  .child {   width: 100%; }  @media (min-width: 1024px) {    .child {     width: 25%;   } }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;parent&quot;&gt;   &lt;div class=&quot;child&quot;&gt;1&lt;\/div&gt;   &lt;div class=&quot;child&quot;&gt;2&lt;\/div&gt;   &lt;div class=&quot;child&quot;&gt;3&lt;\/div&gt;   &lt;div class=&quot;child&quot;&gt;4&lt;\/div&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"css\">@media (min-width: 1024px) {    .parent {     display: flex;     flex-wrap: wrap;   }    .child {     width: 25%;   } }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c width:100% \u0438 \u043c\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0443\u0447\u0435\u043b. \u0421\u043f\u0430\u0441\u0438\u0431\u043e<\/em><\/p>\n<p>  <\/p>\n<h2>\u0417\u0430\u0434\u0430\u0432\u0430\u0442\u044c display: block \u0434\u043b\u044f flex-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 flexbox \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 flex-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c display: flex), \u0432\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (flex-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b) \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f blockified.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e display, \u0438 \u0443 \u043d\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u043e\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c inline \u0438\u043b\u0438 inline-block, \u0442\u043e \u043e\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 block, inline-flex -&gt; flex, inline-grid -&gt; grid \u0438 inline-table -&gt; table. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 display: block \u043a flex-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0441\u0430\u043c.<\/p>\n<p>  <\/p>\n<p><strong>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.parent {   display: flex; }  .child {   display: block; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.parent {   display: flex; }<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438 \u0432\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043c\u043e\u0438\u043c\u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u0438!<\/p>\n<p>  <\/p>\n<p><strong>P.S:<\/strong> \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e CSS\/HTML, \u0442\u043e, \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c, \u043f\u0438\u0448\u0438\u0442\u0435 \u043c\u043d\u0435 \u043d\u0430 \u043c\u043e\u044e \u043f\u043e\u0447\u0442\u0443. \u041e\u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0444\u0438\u043b\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435.<\/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\/post\/549606\/\"> https:\/\/habr.com\/ru\/post\/549606\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u0411\u044b\u0442\u0443\u0435\u0442 \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e CSS \u0441\u043b\u043e\u0436\u043d\u044b\u0439. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439, \u043c\u0430\u0433\u0438\u0438. \u041b\u0435\u0433\u043a\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043a\u043e\u043b\u0435\u043d\u043e. \u041c\u0435\u043d\u044f \u044d\u0442\u043e \u043f\u0435\u0447\u0430\u043b\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u0442\u0430\u043a \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0432, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044f \u0441\u043e\u0431\u0440\u0430\u043b 5 \u043f\u0440\u0438\u0432\u044b\u0447\u0435\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f, \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a \u0438\u0445 \u0438\u0437\u0431\u0435\u0436\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-320842","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320842","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=320842"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320842\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}