{"id":1955,"date":"2021-05-24T19:01:38","date_gmt":"2021-05-24T19:01:38","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=1955"},"modified":"2021-05-24T19:01:38","modified_gmt":"2021-05-24T19:01:38","slug":"%d0%ba%d0%b0%d0%ba%d0%b8%d0%b5-%d0%b7%d0%bd%d0%b0%d1%87%d0%b5%d0%bd%d0%b8%d1%8f-%d0%bc%d0%be%d0%b6%d0%bd%d0%be-%d0%b7%d0%b0%d0%b4%d0%b0%d1%82%d1%8c-css-%d0%bf%d0%b5%d1%80%d0%b5%d0%bc%d0%b5%d0%bd%d0%bd","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=1955","title":{"rendered":"\u041a\u0430\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c CSS \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439?"},"content":{"rendered":"\n<p>CSS \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438,, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u041e\u043d\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c custom property \u043d\u043e\u0442\u0430\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. &#8211;main-color: black;) \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e var() (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. color: var(&#8211;main-color);) .<\/p>\n\n\n\n<p>\u0412 CSS \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<br><em>1. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 CSS<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> :root {\n   --nice-padding: 20px;\n }\n\n article {\n   padding: var(--nice-padding);\n }\n\n<\/code><\/pre>\n\n\n\n<p><em>2. \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e calc() \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 CSS \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> {\n  --image-width: 800px;\n  --image-height: calc(var(--image-width) \/ (4\/3));\n }\n\n img {\n   width: var(--image-width);\n   height: var(--image-height);\n }\n\n<\/code><\/pre>\n\n\n\n<p><em>3. \u041f\u0440\u043e\u0441\u0442\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 calc()<br><\/em><code> :root { --magic-number: 41; } .crazy-box { width: calc(var(--magic-number) * 1%); } <\/code><em>4. \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 content \u0438\u043b\u0438 background<br><\/em><code> :root { --image-from-somewhere: url(https:\/\/codersblock.com\/assets\/images\/logo.png); } .a { background-image: var(--image-from-somewhere); } <\/code>\u0418 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSS \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438,, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[132],"tags":[105],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1955"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1955"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1955\/revisions"}],"predecessor-version":[{"id":1956,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1955\/revisions\/1956"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}