{"id":301396,"date":"2020-04-07T03:00:16","date_gmt":"2020-04-07T03:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301396"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301396","title":{"rendered":"\u041c\u043e\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e CSS \u0441 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438. \u0427\u0430\u0441\u0442\u044c 1 \u00abCSS \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b\u00bb"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495992\/\">\n<p>\u042f \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e, \u0438 \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u043b\u043e \u0434\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e CSS, \u0442\u043e \u043e\u043d\u0438 \u0441\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043a: &quot;\u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0432\u0441\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430&quot;. \u041f\u043e\u0441\u043b\u0435 5 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u043d\u0430\u0434\u043e\u0435\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043e CSS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0437\u0430\u0434\u0430\u044e \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e. \u0418 \u043d\u0430\u0447\u043d\u0443 \u044f \u0441 CSS \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"voprosy\">\u0412\u043e\u043f\u0440\u043e\u0441\u044b<\/h2>\n<p>  <\/p>\n<p><strong>\u04121. \u041a\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u044f \u043c\u043e\u0433\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 button, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 disabled?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u04122. \u041a\u0430\u043a \u044f \u043c\u043e\u0433\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 span, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u0437\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c input?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u04123. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 input, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 type \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &quot;radio&quot;.<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u04124. \u0415\u0441\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0421\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;some-element&quot;&gt;some text&lt;\/div&gt; &lt;div class=&quot;some-element&quot;&gt;some text&lt;\/div&gt; &lt;article class=&quot;some-element&quot;&gt;some text&lt;\/article&gt;<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0441\u043b\u0443\u0447\u0430\u0439 1<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.some-element:first-child {   background-color: purple; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0441\u043b\u0443\u0447\u0430\u0439 2<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.some-element:first-of-type {   background-color: purple; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04125. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :root?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u04126. \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :placeholder-shown?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u04127. \u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0432 CSS \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.list__item {   margin-right: 10px; }  .list__item:last-child {   margin-right: 0; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04128. \u041a\u0430\u043a \u044f \u043c\u043e\u0433\u0443 \u0437\u0430\u0434\u0430\u0442\u044c CSS \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u0444\u043e\u043a\u0443\u0441\u0435?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u04129. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0432\u0435\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041210. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 button, \u043a\u043e\u0433\u0434\u0430 URL \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u044d\u0448 #somehash? \u0414\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434.<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;some-parent&quot;&gt;   &lt;button id=&quot;somehash&quot; type=&quot;button&quot;&gt;Some button&lt;\/button&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"otvety\">\u041e\u0442\u0432\u0435\u0442\u044b<\/h2>\n<p>  <\/p>\n<p><strong>\u04121. \u041a\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u044f \u043c\u043e\u0433\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 button, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 disabled?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 disabled, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<pre><code class=\"css\">button[disabled] {   opacity: 0.24; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04122. \u041a\u0430\u043a \u044f \u043c\u043e\u0433\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 span, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u0437\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c input?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u0436\u043d\u044b\u0439 (+).<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">input + span {   opacity: 0.24; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04123. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 input, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 type \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &quot;radio&quot;.<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 type=&quot;radio&quot; \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">input[type=&quot;radio&quot;] {   opacity: 0.24; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04124. \u0415\u0441\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0421\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;some-element&quot;&gt;some text&lt;\/div&gt; &lt;div class=&quot;some-element&quot;&gt;some text&lt;\/div&gt; &lt;article class=&quot;some-element&quot;&gt;some text&lt;\/article&gt;<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0441\u043b\u0443\u0447\u0430\u0439 1<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.some-element:first-child {   background-color: purple; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0441\u043b\u0443\u0447\u0430\u0439 2<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.some-element:first-of-type {   background-color: purple; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 2.<\/p>\n<p>  <\/p>\n<p><strong>\u04125. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :root?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  :root \u2014 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 HTML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 html. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 SVG \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 svg.<\/p>\n<p>  <\/p>\n<p><strong>\u04126. \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :placeholder-shown?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u041f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :placeholder-shown \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 input \u0438\u043b\u0438 textarea \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f placeholder. \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u043e placeholder \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :placeholder-shown \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">input:placeholder-shown {   background-color: lightgray; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04127. \u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0432 CSS \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.list__item {   margin-right: 10px; }  .list-item:last-child {   margin-right: 0; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c margin-right \u043d\u0430 the margin-left \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :nth-child. <\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.list__item:nth-child(n+2) {   margin-left: 10px; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441\u044b :not() \u0438:last-child, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c margin-right.<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.list__item:not(:last-child) {   margin-right: 10px; }  \/* or *\/ .list__item:not(:first-child) {   margin-left: 10px; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04128. \u041a\u0430\u043a \u044f \u043c\u043e\u0433\u0443 \u0437\u0430\u0434\u0430\u0442\u044c CSS \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u0444\u043e\u043a\u0443\u0441\u0435?<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :focus-within.<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;some-parent&quot;&gt;   &lt;button type=&quot;button&quot;&gt;Some button&lt;\/button&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"css\">.some-parent:focus-within {   outline: 2px solid purple;   outline-offset: 5px; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u04129. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0432\u0435\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c tbody:hover \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c opacity \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a. \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0447\u0442\u043e\u0431\u044b opacity \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c \u043d\u0430 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c :not(:hover).<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">tbody:hover tr:not(:hover) {   opacity: 0.24; }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041210. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 button, \u043a\u043e\u0433\u0434\u0430 URL \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u044d\u0448 #somehash? \u0414\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434.<\/strong> <\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;some-parent&quot;&gt;   &lt;button id=&quot;somehash&quot; type=&quot;button&quot;&gt;Some button&lt;\/button&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442<\/strong><br \/>  \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441 :target.<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">button:target {   background-color: purple; }<\/code><\/pre>\n<p>  <\/p>\n<p>P.S: \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/www.patreon.com\/melnik909\" rel=\"nofollow\">\u043c\u043e\u0435\u043c Patreon<\/a>. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.patreon.com\/posts\/introduction-to-34774556\" rel=\"nofollow\">\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e Patreon<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/495992\/\"> https:\/\/habr.com\/ru\/post\/495992\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495992\/\">\n<p>\u042f \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e, \u0438 \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u043b\u043e \u0434\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e CSS, \u0442\u043e \u043e\u043d\u0438 \u0441\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043a: &quot;\u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0432\u0441\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430&quot;. \u041f\u043e\u0441\u043b\u0435 5 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u043d\u0430\u0434\u043e\u0435\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043e CSS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0437\u0430\u0434\u0430\u044e \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e. \u0418 \u043d\u0430\u0447\u043d\u0443 \u044f \u0441 CSS \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301396","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301396","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=301396"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301396\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}