{"id":10505,"date":"2022-08-24T22:01:05","date_gmt":"2022-08-24T14:01:05","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10505"},"modified":"2022-08-31T16:51:09","modified_gmt":"2022-08-31T08:51:09","slug":"css-has-pseudo-class","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2022\/08\/css-has-pseudo-class\/","title":{"rendered":"\u6765\u4e86\uff0c\u6765\u4e86\uff0cCSS :has()\u4f2a\u7c7b\u5979\u6765\u4e86"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10505\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=10505<\/a> \u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<br \/>\n\u672c\u6587\u6b22\u8fce\u5206\u4eab\u4e0e\u805a\u5408\uff0c\u5168\u6587\u8f6c\u8f7d\u5c31\u4e0d\u5fc5\u4e86\uff0c\u5c0a\u91cd\u7248\u6743\uff0c\u5708\u5b50\u5c31\u8fd9\u4e48\u5927\uff0c\u82e5\u6025\u7528\u53ef\u4ee5\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p><script>window.wxShareImgUrl = 'https:\/\/www.zhangxinxu.com\/study\/image\/share\/202208-has.png';<\/script><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202208\/has-coming.png\" width=\"480\" height=\"305\" alt=\"\u4e91\u548c\u68af\u5b50\" class=\"alignright thumb clip size-medium\" \/><\/p>\n<h3>\u4e00\u3001\u6545\u4e8b\u7684\u80cc\u666f\u548c\u6982\u8981<\/h3>\n<p><code>:has()<\/code> \u4f2a\u7c7b\u662f\u4e00\u4e2a\u529f\u80fd\u975e\u5e38\u5f3a\u5927\u7684\u4f2a\u7c7b\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c\u201c\u7236\u9009\u62e9\u5668\u201d\u548c\u201c\u524d\u9762\u5144\u5f1f\u9009\u62e9\u5668\u201d\u7684\u529f\u80fd\uff0c\u5bf9CSS\u7684\u5f00\u53d1\u4f1a\u6709\u98a0\u8986\u6027\u7684\u5f71\u54cd\u3002<\/p>\n<p><code>:has()<\/code> \u4f2a\u7c7b\u7684\u89c4\u8303\u5236\u5b9a\u5f97\u5f88\u65e9\uff0c\u4f46\u662f\u5374\u4e00\u76f4\u6ca1\u6709\u5f97\u5230\u652f\u6301\u3002<\/p>\n<p>\u4e3b\u8981\u662f\u6d4f\u89c8\u5668\u5382\u5546\u987e\u5fcc\u6027\u80fd\u7684\u5f71\u54cd\uff0c\u8981\u77e5\u9053\uff0cDOM \u7684\u6e32\u67d3\u662f\u4ece\u4e0a\u5f80\u4e0b\uff0c\u4ece\u5185\u5f80\u5916\u7684\u3002<\/p>\n<p>\u800c <code>:has()<\/code> \u4f2a\u7c7b\u7684\u7684\u7279\u6027\u5c31\u662f\u5b50\u5143\u7d20\u5f71\u54cd\u7956\u5148\u5143\u7d20\uff0c\u524d\u9762\u7684\u5144\u5f1f\u5143\u7d20\u5f71\u54cd\u540e\u9762\u7684\u5144\u5f1f\u5143\u7d20\uff0c\u82e5\u60f3\u8981\u6210\u529f\u6e32\u67d3\uff0c\u5fc5\u7136\u9700\u8981\u5728\u5b50\u5143\u7d20\u6216\u8005\u540e\u65b9\u5143\u7d20\u52a0\u8f7d\u5b8c\u6bd5\u624d\u53ef\u4ee5\uff0c\u8fd9\u5fc5\u7136\u4f1a\u5f71\u54cd\u7f51\u9875\u7684\u6e32\u67d3\u901f\u5ea6\u3002<\/p>\n<p>\u56e0\u6b64\u4ee5\u81f3\u4e8e\u4e00\u5f00\u59cb <code>:has()<\/code> \u4f2a\u7c7b\u7684\u89c4\u8303\u4e2d\u660e\u786e\u6b64\u4f2a\u7c7b\u4e0d\u80fd\u5728CSS\u6837\u5f0f\u4e2d\u4f7f\u7528\uff0c\u53ea\u80fd\u5728\u7c7b\u4f3c <code>document.querySelector()<\/code> \u8fd9\u6837\u7684 DOM \u65b9\u6cd5\u4e2d\u4f7f\u7528\u3002<\/p>\n<p>\u57281998\u5e74\uff0cCSS2 \u89c4\u8303\u5236\u5b9a\u7684\u65f6\u5019\uff0c\u5e26\u6765\u4e86 <code>a>b<\/code> \u8fd9\u6837\u7684 CSS \u9009\u62e9\u5668\uff0c\u53ef\u4ee5\u5339\u914d\u5b50\u5143\u7d20\uff0c\u975e\u5e38\u5b9e\u7528\u7684\u80fd\u529b\uff0c\u5f53\u65f6\u5c31\u6709\u5f88\u591a\u8ba8\u8bba\uff0c\u4ec0\u4e48\u65f6\u5019\u53ef\u4ee5\u51fa\u73b0\u5339\u914d\u7236\u5143\u7d20\u7684\u9009\u62e9\u5668\uff0c\u56e0\u4e3a\u4e00\u65e6\u8fd9\u6837\u7684\u80fd\u529b\u652f\u6301\uff0c\u8bb8\u8bb8\u591a\u591a\u539f\u672c\u9700\u8981 JS \u4ee3\u7801\u5904\u7406\u7684\u4ea4\u4e92\u90fd\u53ef\u4ee5\u7701\u7565\u4e86\u3002<\/p>\n<p>\u7ed3\u679c\u4e00\u7b49\u5c31\u662f24\u5e74\uff0c\u4e5f\u5c31\u662f2022\u5e74\uff0c\u968f\u7740Safari\u6d4f\u89c8\u5668\u5f00\u59cb\u5bf9:has()\u4f2a\u7c7b\u8fdb\u884c\u652f\u6301\uff0cCSS\u4e16\u754c\u624d\u62c9\u5f00\u4e86\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c\u7236\u9009\u62e9\u5668\u529f\u80fd\u7684\u5927\u5e55\u3002<\/p>\n<p>\u4e3a\u4f55\u7a81\u7136\u5c31\u652f\u6301\u4e86\u5462\uff1f<\/p>\n<p>\u90a3\u5c31\u4e0d\u5f97\u4e0d\u63d0\u4e00\u4e0b\u540d\u4e3aIgalia\u7684\u8457\u540d\u7684\u79c1\u4eba\u54a8\u8be2\u516c\u53f8\uff0c\u8fd9\u5bb6\u516c\u53f8\u4ee5\u5bf9\u5f00\u653e\u6e90\u4ee3\u7801\u548c\u5f00\u653e\u6807\u51c6\u7684\u8d21\u732e\u548c\u627f\u8bfa\u800c\u95fb\u540d\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4JavaScript\u4e2d\u7684generator\uff0casync\/await\uff0cBigInt, <del datetime=\"2022-08-31T08:48:55+00:00\">temporal<\/del>, Class Fields\uff0cCSS \u4e2d\u7684 Grid \u5e03\u5c40\uff0c\u751a\u81f3Chrome\u6d4f\u89c8\u5668\u4e2d\u7684 MathML \u90fd\u662f\u8fd9\u5bb6\u516c\u53f8\u5728\u5176\u4ed6\u516c\u53f8\u7684\u8d5e\u52a9\u4e0b\u5543\u4e0b\u6765\u7684\u3002<\/p>\n<p>\u800c <code>:has()<\/code> \u4f2a\u7c7b\u5219\u662f\u8fd9\u5bb6\u516c\u53f8\u7684\u53c8\u4e00\u529b\u4f5c\uff0c\u641e\u5b9a\u4e86\u6d4f\u89c8\u5668\u51e0\u5341\u5e74\u90fd\u65e0\u6cd5\u89e3\u51b3\u7684\u6027\u80fd\u95ee\u9898\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u8fd8\u80fd\u8bf4\u4ec0\u4e48\uff0c\u8d5e\u53f9\uff0c\u7136\u540e\u6b22\u547c\u5427\uff0c\u8fce\u63a5 <code>:has()<\/code> \u4f2a\u7c7b\u65f6\u4ee3\u7684\u5230\u6765\u5427\u3002<\/p>\n<p>\u5c31\u5728\u6211\u5199\u4e0b\u8fd9\u6bb5\u5185\u5bb9\u7684\u6b64\u523b\uff0cSafari 15.4\u4ee5\u53caChrome 105\u5747\u5df2\u7ecf\u5b8c\u6210\u652f\u6301\u4e86 <code>:has()<\/code> \u4f2a\u7c7b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202208\/2022-08-21_231819.png\" width=\"653\" height=\"252\" alt=\":has\u4f2a\u7c7b\u7684\u517c\u5bb9\u6027\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u4ee5\u76ee\u524d\u6d4f\u89c8\u5668\u7684\u7248\u672c\u66f4\u65b0\u901f\u5ea6\uff0c\u4e0d\u51fa\u4e00\u5e74\uff0c<code>:has()<\/code> \u4f2a\u7c7b\u5c31\u53ef\u4ee5\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u4f7f\u7528\u4e86\uff0c\u8fd9\u662f\u4e00\u4e2a\u52a1\u5fc5\u8981\u5b66\u4e60\u7684CSS\u4f2a\u7c7b\uff0c\u53ef\u4ee5\u5728\u5f88\u591a\u573a\u5408\u51cf\u5c11\u5f00\u53d1\u7684\u6210\u672c\u3002<\/p>\n<h3>\u4e8c\u3001:has()\u4f2a\u7c7b\u7684\u8bed\u6cd5\u548c\u4f5c\u7528<\/h3>\n<p><code>:has()<\/code> \u4f2a\u7c7b\u7684\u8bed\u6cd5\u6bd4\u8f83\u7b80\u5355\uff0c\u5b66\u4e60\u4e0a\u624b\u4e5f\u5f88\u5bb9\u6613\uff0c\u56e0\u4e3a\u5176\u8bed\u4e49\u975e\u5e38\u660e\u786e\uff0c\u548c\u6e32\u67d3\u8868\u73b0\u4fdd\u6301\u4e00\u81f4\uff0c\u610f\u601d\u662f\u67d0\u67d0\u5143\u7d20\u5982\u679c\u5339\u914d\u67d0\u67d0\u9009\u62e9\u5668\uff0c\u5c31\u4f1a\u5339\u914d\u3002<\/p>\n<p>\u4e3e\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u4e0b\u9762\u7684 CSS \u4ee3\u7801\u8868\u793a\u5982\u679c <code>&lt;a&gt;<\/code> \u5143\u7d20\u91cc\u9762\u6709 <code>&lt;img&gt;<\/code> \u5143\u7d20\uff0c\u5219\u8fd9\u4e2a <code>&lt;a&gt;<\/code> \u5143\u7d20\u5c31\u4f1a\u5339\u914d\u3002<\/p>\n<pre>a:has(img) { display: block; }<\/pre>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u9009\u62e9\u5668\u8f7b\u677e\u533a\u5206\u662f\u6587\u5b57\u94fe\u63a5\u8fd8\u662f\u56fe\u50cf\u94fe\u63a5\uff0c\u5e76\u8bbe\u7f6e\u4e0d\u540c\u7684CSS\u6837\u5f0f\u3002<\/p>\n<p><code>:has()<\/code>\u4f2a\u7c7b\u652f\u6301\u6240\u6709\u7684CSS\u9009\u62e9\u7b26\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>a:has(&gt; img) { display: block; }<\/pre>\n<p>\u8868\u793a\u5339\u914d\u5b50\u5143\u7d20\u662f <code>&lt;img&gt;<\/code> \u5143\u7d20\u7684 <code>&lt;a&gt;<\/code> \u5143\u7d20\u4f1a\u88ab\u5339\u914d\uff0c\u800c\u5173\u7cfb\u66f4\u8fdc\u7684\u540e\u4ee3\u5143\u7d20\u5219\u4e0d\u8003\u8651\u3002<\/p>\n<p>\u6ce8\u610f\u4e0a\u9762\u4ee3\u7801\u4e2d <code>:has<\/code> \u4f2a\u7c7b\u7684\u53c2\u6570\uff0c\u9009\u62e9\u7b26<code>&gt;<\/code>\u76f4\u63a5\u5199\u5728\u4e86\u53c2\u6570\u7684\u6700\u524d\u9762\uff0c\u800c\u4e0d\u662f <code>a:has(a &gt; img)<\/code> \u8fd9\u6837\u7684\u5199\u6cd5\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u7406\u89e3\u4e3a <code>:has()<\/code> \u4f2a\u7c7b\u7684\u53c2\u6570\u7684\u6700\u524d\u9762\u6709\u4e00\u4e2a\u770b\u4e0d\u89c1\u7684 <code>:scope<\/code> \u4f2a\u7c7b\uff0c\u56e0\u6b64\uff0c<code>a:has(a &gt; img)<\/code>\u8fd9\u6837\u7684\u5199\u6cd5\u662f\u4e0d\u5408\u6cd5\u7684\u3002<\/p>\n<p>\u7c7b\u4f3c\u7684\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528+\u6216\u8005~\u8fd9\u6837\u7684\u9009\u62e9\u7b26\uff0c\u53ef\u4ee5\u5b9e\u73b0\u201c\u524d\u9762\u5144\u5f1f\u9009\u62e9\u5668\u201d\u7684\u6548\u679c\uff0c\u5373\u6839\u636e\u540e\u9762\u7684\u5144\u5f1f\u5143\u7d20\u9009\u62e9\u524d\u9762\u7684\u5143\u7d20\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>h5:has(+\u00a0p)\u00a0{ font-size: 1rem; }<\/pre>\n<p>\u8868\u793a\u5339\u914d\u540e\u9762\u8ddf\u968f <code>&lt;p&gt;<\/code> \u5143\u7d20\u7684 <code>&lt;h5&gt;<\/code> \u5143\u7d20\u3002<\/p>\n<p><code>:has()<\/code>\u4f2a\u7c7b\u8fd8\u652f\u6301\u590d\u6742\u9009\u62e9\u5668\u548c\u9009\u62e9\u5668\u5217\u8868\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>article:has(h5, p)\u00a0{ background-color: #f0f3f9; }<\/pre>\n<p>\u8868\u793a\uff0c\u53ea\u9700\u8981 <code>&lt;article&gt;<\/code> \u5143\u7d20\u5185\u6709 <code>&lt;h5&gt;<\/code> \u5143\u7d20\u6216\u8005\u6709 <code>&lt;p&gt;<\/code> \u5143\u7d20\u5c31\u4f1a\u5339\u914d\uff0c\u662f\u6216\u7684\u5173\u7cfb\uff0c\u4e0d\u662f\u4e0e\u3002\u5982\u679c\u5e0c\u671b\u662f\u4e0e\u7684\u5173\u7cfb\uff0c\u4e5f\u5c31\u662f\u540c\u65f6\u6709 <code>&lt;h5&gt;<\/code> \u5143\u7d20\u548c <code>&lt;p&gt;<\/code> \u5143\u7d20\u624d\u5339\u914d\uff0c\u5219\u53ef\u4ee5\u8bd5\u8bd5\u4e0b\u9762\u7684\u5199\u6cd5\uff1a<\/p>\n<pre>article:has(h5):has(p)\u00a0{ background-color: #f0f3f9; }<\/pre>\n<p><code>:has()<\/code> \u4f2a\u7c7b\u8fd8\u53ef\u4ee5\u548c\u5176\u4ed6\u4f2a\u7c7b\u6df7\u7528\uff0c\u4f8b\u5982 <code>:checked<\/code>\u3001<code>:enabled<\/code> \u7b49\uff0c\u751a\u81f3\u8fd8\u53ef\u4ee5\u548c\u5176\u4ed6\u903b\u8f91\u4f2a\u7c7b\u6df7\u7528\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>section:not(:has(h5)) {\r\n  border: skyblue solid;\r\n}\r\nsection:has(:not(h5)) {\r\n  color: deepskyblue;\r\n}<\/pre>\n<p>\u6ce8\u610f\uff0c\u4e0a\u9762\u8fd9\u4e24\u4e2a\u9009\u62e9\u5668\u6240\u8868\u793a\u7684\u542b\u4e49\u662f\u4e0d\u4e00\u6837\u7684\u3002<\/p>\n<p>\u524d\u9762\u7684\u9009\u62e9\u5668\u8868\u793a\u6ca1\u6709\u5305\u542b <code>&lt;h5&gt;<\/code> \u5143\u7d20\u7684 <code>&lt;section&gt;<\/code> \u5143\u7d20\u6709\u5929\u84dd\u8272\u8fb9\u6846\uff0c\u800c\u540e\u8005\u8868\u793a\u5305\u542b\u4e0d\u662f <code>&lt;h5&gt;<\/code> \u5143\u7d20\u7684 <code>&lt;section&gt;<\/code> \u5143\u7d20\u989c\u8272\u6df1\u5929\u84dd\u8272\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4\u73b0\u5728\u6709\u5982\u4e0b\u6240\u793a\u7684 HTML \u4ee3\u7801\uff1a<\/p>\n<pre>&lt;section&gt;\r\n  &lt;p&gt;\u53ea\u6709p\u5143\u7d20&lt;\/p&gt;\r\n&lt;\/section&gt;\r\n&lt;section&gt;\r\n  &lt;h5&gt;\u4e0d\u4ec5\u6709h5\u5143\u7d20&lt;\/h5&gt;\r\n  &lt;p&gt;\u8fd8\u6709p\u5143\u7d20&lt;\/p&gt;\r\n&lt;\/section&gt;<\/pre>\n<p>\u5219\u6b64\u65f6\u53ea\u6709\u4e0a\u9762\u7684 <code>&lt;section&gt;<\/code> \u5143\u7d20\u4f1a\u6709\u8fb9\u6846\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u4e2a <code>&lt;section&gt;<\/code> \u5143\u7d20\u6ca1\u6709\u5305\u542b <code>&lt;h5&gt;<\/code> \u5143\u7d20\uff0c\u800c\u989c\u8272\u53d8\u5316\u4f1a\u540c\u65f6\u53d1\u751f\u5728\u4e24\u4e2a <code>&lt;section&gt;<\/code> \u5143\u7d20\uff0c\u56e0\u4e3a\u8fd9\u4e24\u4e2a <code>&lt;section&gt;<\/code> \u5143\u7d20\u90fd\u5b58\u5728\u4e0d\u662f <code>&lt;h5&gt;<\/code> \u7684\u540e\u4ee3\u5143\u7d20\u3002<\/p>\n<p>\u6b64\u65f6\u7684\u6e32\u67d3\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202208\/2022-08-21_232649.png\" width=\"381\" height=\"187\" alt=\":not :has \u6e32\u67d3\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u81f3\u4e8e <code>:has()<\/code> \u4f2a\u7c7b\u53ef\u4ee5\u5b9e\u9645\u5e94\u7528\u7684\u573a\u666f\uff0c\u90a3\u5b9e\u5728\u662f\u592a\u591a\u4e86\uff0c\u4ea4\u4e92\u5339\u914d\uff0c\u8fb9\u754c\u573a\u666f\u5224\u65ad\u7b49\uff0c\u56e0\u4e3aWeb\u5f00\u53d1\u4e2d\u9700\u8981\u6839\u636e\u67d0\u4e9b\u5143\u7d20\u53d8\u5316\u4ea7\u751f\u8054\u52a8\u53cd\u5e94\u7684\u4f8b\u5b50\u592a\u591a\u4e86\u3002<\/p>\n<p>\u6709\u4e86<code>:has()<\/code>\u4f2a\u7c7b\uff0c\u7406\u8bba\u4e0a\u9875\u9762\u4e2d\u4efb\u610fDOM\u53d8\u5316\u90fd\u53ef\u4ee5\u88ab\u5176\u4ed6DOM\u5143\u7d20\u611f\u77e5\u5230\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>body:has(.eleA-active) .eleB {\r\n  background-color: var(--primary-color);\r\n  color: #fff;\r\n}<\/pre>\n<p>\u662f\u4e0d\u662f\u7acb\u9a6c\u5c31\u61c2\u4e86\uff1f<\/p>\n<h3>\u4e09\u3001\u6b22\u8fce\u8f6c\u53d1\uff0c\u6b22\u8fce\u5206\u4eab<\/h3>\n<p>\u76ee\u524dFirefox\u5f00\u542f\u5b9e\u9a8c\u652f\u6301\u4e5f\u53ef\u4ee5\u4f53\u9a8c <code>:has()<\/code> \u4f2a\u7c7b\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6240\u6709\u73b0\u4ee3\u6d4f\u89c8\u5668\u652f\u6301 <code>:has()<\/code> \u4f2a\u7c7b\u5df2\u7ecf\u662f\u677f\u4e0a\u9489\u9489\u7684\u4e8b\u60c5\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202208\/2022-08-24_214832.png\" width=\"715\" height=\"413\" alt=\":has\u5728Firefox\u6d4f\u89c8\u5668\u4e0b\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u6240\u4ee5\uff0c\u5927\u5bb6\u8010\u5fc3\u70b9\uff0c\u6628\u665a\u660e\u5e74\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u53ef\u4ee5\u653e\u5fc3\u5728\u5185\u90e8\u9879\u76ee\uff0c\u6216\u8005\u5b9e\u9a8c\u6027\u8d28\u7684\u9879\u76ee\u4e2d\u4f7f\u7528\u4e86\uff0c\u5230\u65f6\u5019\uff0c\u6211\u4eec\u7684\u5f00\u53d1\u6210\u672c\u4f1a\u8fdb\u4e00\u6b65\u964d\u4f4e\u3002<\/p>\n<p>\u597d\u6fc0\u52a8\uff0c\u597d\u671f\u5f85\u3002<\/p>\n<p>\u4e0d\u8fc7\u6211\u8fd8\u662f\u9690\u9690\u6709\u4e9b\u62c5\u5fc3\u8981\u662f\u5927\u89c4\u6a21\u4f7f\u7528\uff0c\u4f1a\u4e0d\u4f1a\u6709\u6027\u80fd\u95ee\u9898\u3002<\/p>\n<p>\u8fd9\u4e2a\u65e5\u540e\u5b9e\u8df5\u5b9e\u8df5\u518d\u770b\u5427\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u5c31\u8bf4\u8fd9\u4e48\u591a\u3002<\/p>\n<p>\u6b22\u8fce\u8f6c\u53d1\uff0c\u6b22\u8fce<button onclick=\"shareWeixin.click()\" class=\"entry-share-btn\">\u5206\u4eab<\/button>\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/emtion\/emoji\/2764.svg\" width=\"20\" height=\"20\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u6b22\u8fce\u5206\u4eab\uff0c\u52ff\u5168\u6587\u8f6c\u8f7d\uff0c\u5982\u679c\u5b9e\u5728\u559c\u6b22\uff0c\u53ef\u6536\u85cf\uff0c\u6c38\u4e0d\u8fc7\u671f\uff0c\u4e14\u4f1a\u53ca\u65f6\u66f4\u65b0\u77e5\u8bc6\u70b9\u53ca\u4fee\u6b63\u9519\u8bef\uff0c\u9605\u8bfb\u4f53\u9a8c\u4e5f\u66f4\u597d\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10505\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=10505<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202208\/has-coming.png\" width=\"160\" height=\"102\" alt=\"\u4e91\u548c\u68af\u5b50\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>\u76fc\u661f\u661f\u76fc\u6708\u4eae\uff0c\u76fc\u4e8624\u5e74\uff0c:has() \u4f2a\u7c7b\u7ec8\u4e8e\u6765\u4e86\uff0c\u5728\u68d8\u624b\u7684\u6027\u80fd\u95ee\u9898\u89e3\u51b3\u4e4b\u540e\uff0c\u8fd9\u662f\u4e00\u4e2a\u795e\u7ea7CSS\u4f2a\u7c7b\uff0c\u4ee5\u540e\u4e00\u5b9a\u4f1a\u5728\u524d\u7aef\u9886\u57df\u6380\u8d77\u4e0d\u5c0f\u7684\u6ce2\u6f9c\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1850,843,1074,212],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/10505"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=10505"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/10505\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=10505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=10505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=10505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}