{"id":394256,"date":"2024-06-29T11:29:57","date_gmt":"2024-06-29T11:29:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=394256"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=394256","title":{"rendered":"<span>\u041a\u0430\u043a \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 position: absolute \u0432 CSS<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d99\/84d\/5ec\/d9984d5ec8f2788bfcc7d6fd871fc5a3.jpg\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d99\/84d\/5ec\/d9984d5ec8f2788bfcc7d6fd871fc5a3.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 CSS. \u0412 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>position<\/code> \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u043e\u043e\u0431\u0449\u0435. <\/p>\n<p>\u041f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043a <a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_171121&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0443<\/a>, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 <code>position: absolute<\/code> \u0432\u043f\u043e\u043b\u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c CSS.<\/p>\n<hr\/>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043d\u0430 5 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. \u0422\u043e\u0433\u0434\u0430 CSS flexbox \u0431\u044b\u043b \u043d\u043e\u0432\u0438\u043d\u043a\u043e\u0439 \u0438 \u043d\u0435 \u043c\u043e\u0433 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 100 %, \u0430 CSS grid \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0441\u044f. \u041c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c CSS. \u041d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u0435\u0445 \u043b\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 CSS flexbox \u0438\u043b\u0438 grid.<\/p>\n<h2>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u0435\u043a<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043c\u044b \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>position: absolute<\/code> \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 CSS grid.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d55\/927\/02d\/d5592702d7b3eb9c0b141b0ffa63ff05.jpeg\" width=\"1600\" height=\"622\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d55\/927\/02d\/d5592702d7b3eb9c0b141b0ffa63ff05.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043d\u0430\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"xml\">&lt;article class=\"card\">     &lt;div class=\"card__thumb\">         &lt;img src=\"assets\/mini-cheesecake.jpg\" alt=\"\">     &lt;\/div>     &lt;div class=\"card__content\">         &lt;h2>&lt;a href=\"#\">Title&lt;\/a>&lt;\/h2>         &lt;p>Subtitle&lt;\/p>     &lt;\/div> &lt;\/article><\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>.card__content<\/code>\u00a0 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e:<\/p>\n<pre><code class=\"css\">.card {     position: relative; }  .card__content {     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 100%;     background: linear-gradient(to top, #000, rgba(0, 0, 0, 0) bottom\/100% 60% no-repeat;     padding: 1rem; }<\/code><\/pre>\n<p>\u041d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0432 <code>position: absolute<\/code> \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>display: grid<\/code>\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 card. \u0417\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<pre><code class=\"css\">.card {     position: relative;     display: grid; }  .card__content {     display: flex;     flex-direction: column;     justify-content: flex-end; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/977\/e21\/0c3\/977e210c314558248f516f3b1582c056.jpeg\" width=\"1600\" height=\"932\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/977\/e21\/0c3\/977e210c314558248f516f3b1582c056.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e CSS grid \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0412 \u043d\u0430\u0448\u0435\u0439 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0432\u0430, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441\u0435\u0442\u043a\u0438:<\/p>\n<pre><code class=\"css\">.card__thumb, .card__content {     grid-column: 1\/2;     grid-row: 1\/2; }<\/code><\/pre>\n<p>\u0410 \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c <code>grid-area<\/code>:<\/p>\n<pre><code>.card__thumb, .card__content {     grid-area: 1\/2; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/7b7\/37e\/a29\/7b737ea2910e79844b338cbe5f570ab6.jpeg\" width=\"1600\" height=\"774\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b7\/37e\/a29\/7b737ea2910e79844b338cbe5f570ab6.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>grid-area: 1\/-1<\/code>. \u00a0<code>-1<\/code>\u00a0\u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0441\u0435\u0442\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<h2>\u041c\u0435\u0442\u043a\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 (must try)<\/h2>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0435\u0433 \u0432 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u043b\u0435\u0432\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0443 \u0436\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u2014 <code>grid-area: 1\/-1<\/code>, \u043d\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0433 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/68b\/7ef\/c98\/68b7efc98c6ee1eeefa41714f9d05cdf.jpeg\" width=\"1600\" height=\"690\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/68b\/7ef\/c98\/68b7efc98c6ee1eeefa41714f9d05cdf.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0435\u0442\u043a\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430:<\/p>\n<pre><code class=\"css\">.card__tag {     align-self: start;     justify-self: start;     \/* Other styles *\/ }<\/code><\/pre>\n<p>\u041f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043c\u0435\u0442\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0434 \u0441\u0432\u043e\u0438\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0431\u0435\u0437 <code>position: absolute<\/code>:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61951da4122cc8f638696873\" data-style=\"\" id=\"61951da4122cc8f638696873\" width=\"\"><\/div>\n<h2>\u0420\u0430\u0437\u0434\u0435\u043b Hero<\/h2>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0440\u0430\u0437\u0434\u0435\u043b hero \u0441 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/708\/4a3\/040\/7084a30402e0b60e8e039802b50f185f.jpeg\" width=\"1600\" height=\"540\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/708\/4a3\/040\/7084a30402e0b60e8e039802b50f185f.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u043e\u0439, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443, \u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0443 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \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. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0441\u043b\u043e\u044f:<\/p>\n<ul>\n<li>\n<p>\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0435 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0442\u0435\u043d\u0442.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/f83\/bbb\/fc7\/f83bbbfc77f6420eac8fca62d0f3253d.jpeg\" width=\"1200\" height=\"466\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f83\/bbb\/fc7\/f83bbbfc77f6420eac8fca62d0f3253d.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435, \u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 <code>background-image<\/code>. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>&lt;img><\/code>:<\/p>\n<pre><code class=\"css\">.hero {     position: relative;     min-height: 500px; }  .hero__thumb {     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 100%;     object-fit: cover; }  \/* The overlay *\/ .hero:after {     content: \"\";     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 100%;     background-color: #000;     opacity: 0.5; }  .hero__content {     position: absolute;     left: 50%;     top: 50%;     z-index: 1;     transform: translate(-50%, -50%);     text-align: center; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a hero \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \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. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a <code>hero<\/code> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>display: grid<\/code>. \u0418 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c <code>grid-area: 1\/-1<\/code> \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u044f\u043c\u043e\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>hero<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/850\/74c\/9e7\/85074c9e7332c39757d77a8729f1d24b.jpeg\" width=\"1854\" height=\"762\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/850\/74c\/9e7\/85074c9e7332c39757d77a8729f1d24b.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0447\u0442\u043e\u0431\u044b <code>.hero__thumb<\/code>\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432\u044b\u0441\u043e\u0442\u0443 hero \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>height: 100%<\/code>, \u0442\u043e \u0435\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>height<\/code>, \u0430 \u043d\u0435\u00a0<code>min-height<\/code>.<\/p>\n<pre><code class=\"css\">.hero {     display: grid;     height: 500px; }  .hero__content {     z-index: 1; \/* [1] *\/     grid-area: 1\/-1;     display: flex;     flex-direction: column;     margin: auto; \/* [2] *\/     text-align: center; }  .hero__thumb {     grid-area: 1\/-1;     object-fit: cover; \/* [3] *\/     width: 100%;     height: 100%;     min-height: 0; \/* [4] *\/ }  .hero:after {     content: \"\";     background-color: #000;     opacity: 0.5;     grid-area: 1\/-1; }<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0439\u0434\u0443 \u043f\u043e \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c \u0441\u0442\u0440\u043e\u043a\u0430\u043c, \u043e\u043d\u0438 \u0432\u0430\u0436\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>z-index<\/code> \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 grid \u0438\u043b\u0438 flex. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code>position: relative<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>.hero__content<\/code>\u00a0 \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 grid, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>margin: auto<\/code> \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c <code>object-fit: cover<\/code>\u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <code>min-height: 0<\/code> \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f <a href=\"https:\/\/ishadeed.com\/article\/the-just-in-case-mindset-css\/\">\u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439<\/a>, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c grid \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c <code>height: 100%<\/code> \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044f hero, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e <a href=\"https:\/\/ishadeed.com\/article\/min-content-size-css-grid\/\">\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0435 <\/a>\u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0432 CSS grid.<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0449\u0435?<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61952061122cc8f638696874\" data-style=\"\" id=\"61952061122cc8f638696874\" width=\"\"><\/div>\n<h2>CSS display: contents<\/h2>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>display: contents<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a6d\/0ab\/6bf\/a6d0ab6bfdbb1a92d1a14267494a85cf.jpeg\" width=\"1854\" height=\"762\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a6d\/0ab\/6bf\/a6d0ab6bfdbb1a92d1a14267494a85cf.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 HTML-\u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;div class=\"hero__content\">         &lt;h2>&lt;!-- Title -->&lt;\/h2>         &lt;p>&lt;!-- Desc -->&lt;\/p>         &lt;a href=\"#\">Order now&lt;\/a>     &lt;\/div>     &lt;img src=\"recipe.jpg\" alt=\"\"> &lt;\/div><\/code><\/pre>\n<p>\u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e. \u041d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/0d5\/11a\/9a8\/0d511a9a879b4bf342bec59bcebbd9c8.jpeg\" width=\"1854\" height=\"932\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d5\/11a\/9a8\/0d511a9a879b4bf342bec59bcebbd9c8.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. \u041a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443? \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;div class=\"hero__content\">         &lt;h2>&lt;!-- Title -->&lt;\/h2>         &lt;img src=\"recipe.jpg\" alt=\"\">         &lt;p>&lt;!-- Desc -->&lt;\/p>         &lt;a href=\"#\">Order now&lt;\/a>     &lt;\/div> &lt;\/div><\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c, \u0430 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c <code>&lt;img><\/code> \u0441\u043f\u0440\u0430\u0432\u0430. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 <code>display: contents<\/code> \u0438 \u043e\u043d\u043e \u043f\u0440\u043e\u0449\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e, \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;div class=\"hero__content\">         &lt;h2>&lt;!-- Title -->&lt;\/h2>         &lt;p>&lt;!-- Desc -->&lt;\/p>         &lt;a href=\"#\">Order now&lt;\/a>     &lt;\/div>     &lt;img src=\"recipe.jpg\" alt=\"\"> &lt;\/div><\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u0451\u0440\u043d\u0443\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 <code>.hero__content<\/code>. \u041a\u0430\u043a \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u043e \u043d\u0430\u0448\u0435\u043c \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b <code>&lt;h2><\/code>, <code>&lt;p><\/code> \u0438 <code>&lt;a><\/code> \u0441\u0442\u0430\u043b\u0438 \u043f\u0440\u044f\u043c\u044b\u043c\u0438 \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438 <code>&lt;img><\/code>? \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>display: contents<\/code>:<\/p>\n<pre><code class=\"css\">.hero__content {     display: contents; }<\/code><\/pre>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442 <code>.hero__content<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u2014 \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u0438\u0437\u0440\u0430\u043a. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;h2>&lt;!-- Title -->&lt;\/h2>     &lt;p>&lt;!-- Desc -->&lt;\/p>     &lt;a href=\"#\">Order now&lt;\/a>     &lt;img src=\"recipe.jpg\" alt=\"\"> &lt;\/div><\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 CSS:<\/p>\n<pre><code class=\"css\">.hero {     display: flex;     flex-direction: column; }  .hero__content {     display: contents; }  .hero h2, .hero img {     order: -1; }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 <code>display: contents<\/code> \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0431\u044b\u043b\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u0445\u043e\u0442\u0438\u043c  \u0442\u0430\u043a \u0436\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0430:<\/p>\n<pre><code class=\"css\">@media (min-width: 750px) {     .hero {         flex-direction: row;     }          .hero__content {         display: initial;     }          .hero h2,     .hero img {         order: initial;     } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/619521d4122cc8f638696875\" data-style=\"\" id=\"619521d4122cc8f638696875\" width=\"\"><\/div>\n<h2>\u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a61\/b72\/63a\/a61b7263a4a30753c72dfe0e643c2bc6.jpeg\" width=\"1854\" height=\"932\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a61\/b72\/63a\/a61b7263a4a30753c72dfe0e643c2bc6.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043a\u043e\u0434 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438, \u0433\u0434\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0451 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 HTML:<\/p>\n<pre><code class=\"xml\">&lt;article class=\"card\">     &lt;img src=\"thumb.jpg\" alt=\"\">     &lt;div class=\"card__content\">         &lt;h3>Title&lt;\/h3>         &lt;p>Description&lt;\/p>         &lt;p>Actions&lt;\/p>     &lt;\/div> &lt;\/article><\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u044f\u043c\u044b\u0445 \u043f\u043e\u0442\u043e\u043c\u043a\u0430 <code>card<\/code>: \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>thumb.jpg<\/code> \u0438 <code>div<\/code> \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>card__content<\/code>. \u041a\u0430\u043a \u0441 \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <code>&lt;h3><\/code> \u0432\u0432\u0435\u0440\u0445\u0443? \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\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:<\/p>\n<pre><code class=\"css\">.card {     position: relative;     padding-top: 3rem;     \/* Accommodate for the title space *\/ }  .card h3 {     position: absolute;     left: 1rem;     top: 1rem; }<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/0c2\/b11\/0ea\/0c2b110ea33ad96be040b28681c7222e.jpeg\" width=\"1854\" height=\"932\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c2\/b11\/0ea\/0c2b110ea33ad96be040b28681c7222e.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u043d\u0435 \u0432\u0430\u0436\u043d\u0430 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0430. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>display: contents<\/code> \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e:<\/p>\n<pre><code class=\"css\">.card {     display: flex;     flex-direction: column;     padding: 1rem; }  .card__content {     display: contents; }  .card h3 {     order: -1; }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f \u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>order<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a0c\/c87\/9cc\/a0cc879ccfce726780ae5bc3aaaf3b73.jpeg\" width=\"1854\" height=\"932\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0c\/c87\/9cc\/a0cc879ccfce726780ae5bc3aaaf3b73.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 <code>padding: 1rem<\/code> \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u043b\u0438\u043f\u0430\u0442\u044c \u043a \u043a\u0440\u0430\u044f\u043c. \u0412\u043e\u0442 \u043a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"css\">.card img {     width: calc(100% + 2rem);     margin-left: -1rem; }<\/code><\/pre>\n<h2>\u0426\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0448\u0443\u0442\u043e\u043a \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u043e \u0432 \u043d\u0430\u0448\u0438 \u0434\u043d\u0438 \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>position: absolute<\/code> \u0441 <code>transform<\/code>. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f flex-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>margin: auto<\/code>:<\/p>\n<pre><code class=\"css\">.card {     display: flex; }  .card__image {     margin: auto; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/084\/c25\/292\/084c25292de77474d322bf47d12c8b93.jpeg\" width=\"1854\" height=\"586\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/084\/c25\/292\/084c25292de77474d322bf47d12c8b93.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/ishadeed.com\/article\/learn-css-centering\/\">\u043f\u043e\u043b\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e<\/a> \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0432 CSS.<\/p>\n<h2>\u0421\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041d\u043e\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e CSS <code>aspect-ratio<\/code> \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043a\u0441 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d, \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u0445\u0430\u043a \u0441 <code>padding<\/code>:<\/p>\n<pre><code class=\"css\">.card__thumb {   position: relative;   padding-top: 75%; }  .card__thumb img {   position: absolute;   left: 0;   top: 0;   width: 100%;   height: 100%;   object-fit: cover; }<\/code><\/pre>\n<p>\u0421 <code>aspect-ratio<\/code> \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0449\u0435:<\/p>\n<pre><code class=\"css\">\/*  *\/ .card__thumb {   position: relative;   aspect-ratio: 4\/3; }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/ishadeed.com\/article\/css-aspect-ratio\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u0418\u043d\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 position: absolute<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/f6e\/4b1\/ec5\/f6e4b1ec575b9c019ec52820b178f625.jpeg\" width=\"1854\" height=\"670\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6e\/4b1\/ec5\/f6e4b1ec575b9c019ec52820b178f625.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 (\u0430\u0432\u0430\u0442\u0430\u0440, \u0438\u043c\u044f \u0438 \u0441\u0441\u044b\u043b\u043a\u0430) \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u043e\u0436\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<ol>\n<li>\n<p><code>position: absolute<\/code> \u0434\u043b\u044f \u043e\u0431\u043b\u043e\u0436\u043a\u0438 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 <code>margin<\/code> \u0434\u043b\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041a\u0430\u043a\u043e\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f?<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \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<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a41\/409\/1b6\/a414091b6aa68dc6d91e3fe90d64f4bc.jpeg\" width=\"1854\" height=\"670\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a41\/409\/1b6\/a414091b6aa68dc6d91e3fe90d64f4bc.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>padding: 1rem<\/code> \u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438:<\/p>\n<pre><code class=\"css\">.card__cover {     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 50px; }  .card__content {     padding: 1rem; }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u043b\u043e\u0436\u043a\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u043d\u0430, \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c CSS.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d24\/fcb\/658\/d24fcb658a533b922ba7dda35ccfd307.jpeg\" width=\"1854\" height=\"670\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d24\/fcb\/658\/d24fcb658a533b922ba7dda35ccfd307.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e margin<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u043d\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 <code>margin<\/code> \u043e\u0442 \u0432\u0435\u0440\u0445\u0430:<\/p>\n<pre><code class=\"css\">.card__content {     padding: 1rem;     margin-top: -1rem; }<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u043b\u043e\u0436\u043a\u0430 \u0443 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0435\u0441\u0442\u044c, \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/290\/739\/857\/2907398574ae59fa7fa5e87d8f4b63f0.jpeg\" width=\"1854\" height=\"836\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/290\/739\/857\/2907398574ae59fa7fa5e87d8f4b63f0.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0430\u0432\u0430\u0442\u0430\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (\u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438). \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e, \u0438\u0437\u043c\u0435\u043d\u0438\u043c CSS \u0438 \u0443\u0431\u0435\u0440\u0451\u043c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 <code>margin<\/code>:<\/p>\n<pre><code class=\"css\">.card--no-cover .card__content {     margin-top: 0; }<\/code><\/pre>\n<p>\u041b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c <code>position: absolute<\/code>. \u0417\u0434\u0435\u0441\u044c \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442 \u043b\u0438\u0448\u043d\u0435\u0433\u043e CSS.<\/p>\n<h2>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/h2>\n<ul>\n<li>\n<p>\u0420\u0430\u0439\u0430\u043d \u041c\u0430\u043b\u043b\u0438\u0433\u0430\u043d <a href=\"https:\/\/css-tricks.com\/positioning-overlay-content-with-css-grid\/\">\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b <\/a>\u043e\u0442\u043b\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0432\u0435\u0440\u043b\u0435\u0439\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CSS-grid. <\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u0444\u0430\u043d\u0438 \u042d\u043a\u043b\u0437 <a href=\"https:\/\/moderncss.dev\/3-popular-website-heroes-created-with-css-grid-layout\/\">\u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 <\/a>\u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 CSS-grid \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 hero.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c CSS \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043a\u0443\u0440\u0441\u0430\u0445:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c4e\/440\/568\/c4e440568a64955563f8e1674f991e88.png\" width=\"1000\" height=\"269\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c4e\/440\/568\/c4e440568a64955563f8e1674f991e88.png\"\/><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_171121&amp;utm_term=conc\">\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438<\/a> \u0430\u043a\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_171121&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (7 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_171121&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python (15 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>Data Science \u0438 Machine Learning<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Data Engineering<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438 Deep Learning\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Java \u0438 C#<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430 JAVA<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041e\u0442 \u043e\u0441\u043d\u043e\u0432 \u2014 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_171121&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410 \u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_171121&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_171121&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\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\/589829\/\"> https:\/\/habr.com\/ru\/articles\/589829\/<\/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<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 CSS. \u0412 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>position<\/code> \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u043e\u043e\u0431\u0449\u0435. <\/p>\n<p>\u041f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043a <a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_171121&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0443<\/a>, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 <code>position: absolute<\/code> \u0432\u043f\u043e\u043b\u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c CSS.<\/p>\n<hr\/>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043d\u0430 5 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. \u0422\u043e\u0433\u0434\u0430 CSS flexbox \u0431\u044b\u043b \u043d\u043e\u0432\u0438\u043d\u043a\u043e\u0439 \u0438 \u043d\u0435 \u043c\u043e\u0433 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 100 %, \u0430 CSS grid \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0441\u044f. \u041c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c CSS. \u041d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u0435\u0445 \u043b\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 CSS flexbox \u0438\u043b\u0438 grid.<\/p>\n<h2>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u0435\u043a<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043c\u044b \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>position: absolute<\/code> \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 CSS grid.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043d\u0430\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"xml\">&lt;article class=\"card\">     &lt;div class=\"card__thumb\">         &lt;img src=\"assets\/mini-cheesecake.jpg\" alt=\"\">     &lt;\/div>     &lt;div class=\"card__content\">         &lt;h2>&lt;a href=\"#\">Title&lt;\/a>&lt;\/h2>         &lt;p>Subtitle&lt;\/p>     &lt;\/div> &lt;\/article><\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>.card__content<\/code>\u00a0 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e:<\/p>\n<pre><code class=\"css\">.card {     position: relative; }  .card__content {     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 100%;     background: linear-gradient(to top, #000, rgba(0, 0, 0, 0) bottom\/100% 60% no-repeat;     padding: 1rem; }<\/code><\/pre>\n<p>\u041d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0432 <code>position: absolute<\/code> \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>display: grid<\/code>\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 card. \u0417\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<pre><code class=\"css\">.card {     position: relative;     display: grid; }  .card__content {     display: flex;     flex-direction: column;     justify-content: flex-end; }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e CSS grid \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0412 \u043d\u0430\u0448\u0435\u0439 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0432\u0430, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441\u0435\u0442\u043a\u0438:<\/p>\n<pre><code class=\"css\">.card__thumb, .card__content {     grid-column: 1\/2;     grid-row: 1\/2; }<\/code><\/pre>\n<p>\u0410 \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c <code>grid-area<\/code>:<\/p>\n<pre><code>.card__thumb, .card__content {     grid-area: 1\/2; }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>grid-area: 1\/-1<\/code>. \u00a0<code>-1<\/code>\u00a0\u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0441\u0435\u0442\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<h2>\u041c\u0435\u0442\u043a\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 (must try)<\/h2>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0435\u0433 \u0432 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u043b\u0435\u0432\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0443 \u0436\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u2014 <code>grid-area: 1\/-1<\/code>, \u043d\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0433 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0435\u0442\u043a\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430:<\/p>\n<pre><code class=\"css\">.card__tag {     align-self: start;     justify-self: start;     \/* Other styles *\/ }<\/code><\/pre>\n<p>\u041f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043c\u0435\u0442\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0434 \u0441\u0432\u043e\u0438\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0431\u0435\u0437 <code>position: absolute<\/code>:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61951da4122cc8f638696873\" data-style=\"\" id=\"61951da4122cc8f638696873\" width=\"\"><\/div>\n<h2>\u0420\u0430\u0437\u0434\u0435\u043b Hero<\/h2>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0440\u0430\u0437\u0434\u0435\u043b hero \u0441 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u043e\u0439, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443, \u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0443 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \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. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0441\u043b\u043e\u044f:<\/p>\n<ul>\n<li>\n<p>\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0435 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0442\u0435\u043d\u0442.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435, \u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 <code>background-image<\/code>. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>&lt;img><\/code>:<\/p>\n<pre><code class=\"css\">.hero {     position: relative;     min-height: 500px; }  .hero__thumb {     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 100%;     object-fit: cover; }  \/* The overlay *\/ .hero:after {     content: \"\";     position: absolute;     left: 0;     top: 0;     width: 100%;     height: 100%;     background-color: #000;     opacity: 0.5; }  .hero__content {     position: absolute;     left: 50%;     top: 50%;     z-index: 1;     transform: translate(-50%, -50%);     text-align: center; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a hero \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \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. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a <code>hero<\/code> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>display: grid<\/code>. \u0418 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c <code>grid-area: 1\/-1<\/code> \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u044f\u043c\u043e\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>hero<\/code>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0447\u0442\u043e\u0431\u044b <code>.hero__thumb<\/code>\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432\u044b\u0441\u043e\u0442\u0443 hero \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>height: 100%<\/code>, \u0442\u043e \u0435\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>height<\/code>, \u0430 \u043d\u0435\u00a0<code>min-height<\/code>.<\/p>\n<pre><code class=\"css\">.hero {     display: grid;     height: 500px; }  .hero__content {     z-index: 1; \/* [1] *\/     grid-area: 1\/-1;     display: flex;     flex-direction: column;     margin: auto; \/* [2] *\/     text-align: center; }  .hero__thumb {     grid-area: 1\/-1;     object-fit: cover; \/* [3] *\/     width: 100%;     height: 100%;     min-height: 0; \/* [4] *\/ }  .hero:after {     content: \"\";     background-color: #000;     opacity: 0.5;     grid-area: 1\/-1; }<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0439\u0434\u0443 \u043f\u043e \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c \u0441\u0442\u0440\u043e\u043a\u0430\u043c, \u043e\u043d\u0438 \u0432\u0430\u0436\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>z-index<\/code> \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 grid \u0438\u043b\u0438 flex. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code>position: relative<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>.hero__content<\/code>\u00a0 \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 grid, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>margin: auto<\/code> \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c <code>object-fit: cover<\/code>\u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <code>min-height: 0<\/code> \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f <a href=\"https:\/\/ishadeed.com\/article\/the-just-in-case-mindset-css\/\">\u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439<\/a>, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c grid \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c <code>height: 100%<\/code> \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044f hero, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e <a href=\"https:\/\/ishadeed.com\/article\/min-content-size-css-grid\/\">\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0435 <\/a>\u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0432 CSS grid.<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0449\u0435?<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61952061122cc8f638696874\" data-style=\"\" id=\"61952061122cc8f638696874\" width=\"\"><\/div>\n<h2>CSS display: contents<\/h2>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>display: contents<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 HTML-\u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;div class=\"hero__content\">         &lt;h2>&lt;!-- Title -->&lt;\/h2>         &lt;p>&lt;!-- Desc -->&lt;\/p>         &lt;a href=\"#\">Order now&lt;\/a>     &lt;\/div>     &lt;img src=\"recipe.jpg\" alt=\"\"> &lt;\/div><\/code><\/pre>\n<p>\u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e. \u041d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. \u041a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443? \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;div class=\"hero__content\">         &lt;h2>&lt;!-- Title -->&lt;\/h2>         &lt;img src=\"recipe.jpg\" alt=\"\">         &lt;p>&lt;!-- Desc -->&lt;\/p>         &lt;a href=\"#\">Order now&lt;\/a>     &lt;\/div> &lt;\/div><\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c, \u0430 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c <code>&lt;img><\/code> \u0441\u043f\u0440\u0430\u0432\u0430. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 <code>display: contents<\/code> \u0438 \u043e\u043d\u043e \u043f\u0440\u043e\u0449\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e, \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;div class=\"hero__content\">         &lt;h2>&lt;!-- Title -->&lt;\/h2>         &lt;p>&lt;!-- Desc -->&lt;\/p>         &lt;a href=\"#\">Order now&lt;\/a>     &lt;\/div>     &lt;img src=\"recipe.jpg\" alt=\"\"> &lt;\/div><\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u0451\u0440\u043d\u0443\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 <code>.hero__content<\/code>. \u041a\u0430\u043a \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u043e \u043d\u0430\u0448\u0435\u043c \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b <code>&lt;h2><\/code>, <code>&lt;p><\/code> \u0438 <code>&lt;a><\/code> \u0441\u0442\u0430\u043b\u0438 \u043f\u0440\u044f\u043c\u044b\u043c\u0438 \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438 <code>&lt;img><\/code>? \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>display: contents<\/code>:<\/p>\n<pre><code class=\"css\">.hero__content {     display: contents; }<\/code><\/pre>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442 <code>.hero__content<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u2014 \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u0438\u0437\u0440\u0430\u043a. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;div class=\"hero\">     &lt;h2>&lt;!-- Title -->&lt;\/h2>     &lt;p>&lt;!-- Desc -->&lt;\/p>     &lt;a href=\"#\">Order now&lt;\/a>     &lt;img src=\"recipe.jpg\" alt=\"\"> &lt;\/div><\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 CSS:<\/p>\n<pre><code class=\"css\">.hero {     display: flex;     flex-direction: column; }  .hero__content {     display: contents; }  .hero h2, .hero img {     order: -1; }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 <code>display: contents<\/code> \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0431\u044b\u043b\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u0445\u043e\u0442\u0438\u043c  \u0442\u0430\u043a \u0436\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0430:<\/p>\n<pre><code class=\"css\">@media (min-width: 750px) {     .hero {         flex-direction: row;     }          .hero__content {         display: initial;     }          .hero h2,     .hero img {         order: initial;     } }<\/code><\/pre>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/619521d4122cc8f638696875\" data-style=\"\" id=\"619521d4122cc8f638696875\" width=\"\"><\/div>\n<h2>\u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438<\/h2>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043a\u043e\u0434 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438, \u0433\u0434\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0451 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 HTML:<\/p>\n<pre><code class=\"xml\">&lt;article class=\"card\">     &lt;img src=\"thumb.jpg\" alt=\"\">     &lt;div class=\"card__content\">         &lt;h3>Title&lt;\/h3>         &lt;p>Description&lt;\/p>         &lt;p>Actions&lt;\/p>     &lt;\/div> &lt;\/article><\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u044f\u043c\u044b\u0445 \u043f\u043e\u0442\u043e\u043c\u043a\u0430 <code>card<\/code>: \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>thumb.jpg<\/code> \u0438 <code>div<\/code> \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>card__content<\/code>. \u041a\u0430\u043a \u0441 \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <code>&lt;h3><\/code> \u0432\u0432\u0435\u0440\u0445\u0443? \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\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:<\/p>\n<pre><code class=\"css\">.card {     position: relative;     padding-top: 3rem;     \/* Accommodate for the title space *\/ }  .card h3 {     position: absolute;     left: 1rem;     top: 1rem; }<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u043d\u0435 \u0432\u0430\u0436\u043d\u0430 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0430. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>display: contents<\/code> \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e:<\/p>\n<pre><code class=\"css\">.card {     display: flex;     flex-direction: column;     padding: 1rem; }  .card__content {     display: contents; }  .card h3 {     order: -1; }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f \u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>order<\/code>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 <code>padding: 1rem<\/code> \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u043b\u0438\u043f\u0430\u0442\u044c \u043a \u043a\u0440\u0430\u044f\u043c. \u0412\u043e\u0442 \u043a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"css\">.card img {     width: calc(100% + 2rem);     margin-left: -1rem; }<\/code><\/pre>\n<h2>\u0426\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0448\u0443\u0442\u043e\u043a \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u043e \u0432 \u043d\u0430\u0448\u0438 \u0434\u043d\u0438 \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>position: absolute<\/code> \u0441 <code>transform<\/code>. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f flex-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>margin: auto<\/code>:<\/p>\n<pre><code class=\"css\">.card {     display: flex; }  .card__image {     margin: auto; }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/ishadeed.com\/article\/learn-css-centering\/\">\u043f\u043e\u043b\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e<\/a> \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0432 CSS.<\/p>\n<h2>\u0421\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041d\u043e\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e CSS <code>aspect-ratio<\/code> \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043a\u0441 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d, \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u0445\u0430\u043a \u0441 <code>padding<\/code>:<\/p>\n<pre><code class=\"css\">.card__thumb {   position: relative;   padding-top: 75%; }  .card__thumb img {   position: absolute;   left: 0;   top: 0;   width: 100%;   height: 100%;   object-fit: cover; }<\/code><\/pre>\n<p>\u0421 <code>aspect-ratio<\/code> \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0449\u0435:<\/p>\n<pre><code class=\"css\">\/*  *\/ .card__thumb {   position: relative;   aspect-ratio: 4\/3; }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-394256","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/394256","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=394256"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/394256\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=394256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=394256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=394256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}