{"id":199,"date":"2026-09-06T00:41:02","date_gmt":"2026-09-05T16:41:02","guid":{"rendered":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/modern-css-2026\/"},"modified":"2026-09-06T00:41:02","modified_gmt":"2026-09-05T16:41:02","slug":"modern-css-2026","status":"publish","type":"post","link":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/modern-css-2026\/","title":{"rendered":"2026 \u5e74\u503c\u5f97\u843d\u5730\u7684\u73b0\u4ee3 CSS\uff1a\u5bb9\u5668\u67e5\u8be2\u3001:has()\u3001\u7ea7\u8054\u5c42\u4e0e\u89c6\u56fe\u8fc7\u6e21"},"content":{"rendered":"<div style=\"font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif;font-size:16.5px;line-height:1.9;color:#35435c;letter-spacing:.2px\">\n<div style=\"background:linear-gradient(135deg,#f5f9ff,#eef5ff);border:1px solid #dce8f8;border-left:4px solid #35b98a;border-radius:12px;padding:16px 20px;margin:0 0 24px;font-size:14.5px;color:#3d5570;line-height:2\"><span style=\"display:inline-block;background:#35b98a;color:#fff;font-size:12.5px;font-weight:700;padding:3px 10px;border-radius:6px;margin-right:12px;letter-spacing:1px;vertical-align:1px\">\u5173\u952e\u8bcd<\/span>\u73b0\u4ee3 CSS\u3001\u5bb9\u5668\u67e5\u8be2\u3001has \u9009\u62e9\u5668\u3001\u7ea7\u8054\u5c42\u3001\u89c6\u56fe\u8fc7\u6e21\u3001\u951a\u70b9\u5b9a\u4f4d<\/div>\n<div style=\"background:#fafbfd;border:1px solid #e8edf5;border-radius:12px;padding:18px 22px;margin:0 0 30px\">\n<div style=\"font-size:13.5px;font-weight:700;color:#8a99ae;letter-spacing:2px;margin-bottom:12px\">\u76ee\u5f55<\/div>\n<ol style=\"margin:0;padding-left:20px\">\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-1\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e00\u3001\u5bb9\u5668\u67e5\u8be2\uff1a\u7ec4\u4ef6\u7ec8\u4e8e\u80fd\u81ea\u5df1\u51b3\u5b9a\u957f\u4ec0\u4e48\u6837<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-2\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e8c\u3001:has()\uff1a\u7f3a\u5931\u4e86\u4e8c\u5341\u5e74\u7684\u7236\u9009\u62e9\u5668<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-3\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e09\u3001\u7ea7\u8054\u5c42\uff1a\u628a !important \u6218\u4e89\u63d0\u524d\u7ec8\u7ed3<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-4\" style=\"color:#42546e;text-decoration:none;border:none\">\u56db\u3001\u89c6\u56fe\u8fc7\u6e21\uff1a\u58f0\u660e\u5f0f\u7684\u9875\u9762\u5207\u6362\u52a8\u753b<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-5\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e94\u3001\u8fd8\u6709\u51e0\u9879\u503c\u5f97\u6392\u8fdb\u6280\u672f\u96f7\u8fbe<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-6\" style=\"color:#42546e;text-decoration:none;border:none\">\u516d\u3001\u843d\u5730\u987a\u5e8f\u5efa\u8bae<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-7\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e03\u3001\u5c0f\u7ed3<\/a><\/li>\n<\/ol>\n<\/div>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><span style=\"font-size:17px;color:#1e2f47\">\u8fc7\u53bb\u51e0\u5e74 CSS \u7684\u66f4\u65b0\u5bc6\u5ea6\uff0c\u662f\u8fd9\u95e8\u8bed\u8a00\u8bde\u751f\u4ee5\u6765\u6700\u9ad8\u7684\u3002\u5bb9\u5668\u67e5\u8be2\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has()<\/code>\u3001\u7ea7\u8054\u5c42\u3001\u89c6\u56fe\u8fc7\u6e21\u3001\u951a\u70b9\u5b9a\u4f4d\u2026\u2026\u8fd9\u4e9b\u80fd\u529b\u5355\u72ec\u770b\u662f&#8221;\u53c8\u4e00\u4e2a\u65b0\u5c5e\u6027&#8221;\uff0c\u5408\u5728\u4e00\u8d77\u5374\u6539\u53d8\u4e86\u6837\u5f0f\u8868\u7684<strong style=\"color:#0f1c2e;font-weight:600\">\u7ec4\u7ec7\u65b9\u5f0f<\/strong>\uff1a\u7ec4\u4ef6\u7ec8\u4e8e\u53ef\u4ee5\u771f\u6b63\u72ec\u7acb\uff0c\u52a8\u753b\u7ec8\u4e8e\u53ef\u4ee5\u771f\u6b63\u58f0\u660e\u5f0f\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u672c\u6587\u4e0d\u7f57\u5217\u89c4\u8303\uff0c\u53ea\u8bb2<strong style=\"color:#0f1c2e;font-weight:600\">\u80fd\u5728\u751f\u4ea7\u91cc\u843d\u5730\u7684\u90e8\u5206<\/strong>\uff1a\u6bcf\u9879\u80fd\u529b\u89e3\u51b3\u4ec0\u4e48\u8001\u95ee\u9898\u3001\u4ee3\u7801\u600e\u4e48\u5199\u3001\u4ee5\u53ca\u5fc5\u987b\u77e5\u9053\u7684\u517c\u5bb9\u6027\u7ea2\u7ebf\u3002<\/p>\n<figure style=\"margin:30px 0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"900\" src=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/modern-css-2026-fig.png\" alt=\"\u73b0\u4ee3 CSS \u843d\u5730\u987a\u5e8f\" class=\"wp-image-198\" style=\"max-width:100%;height:auto;border-radius:12px;border:1px solid #e6ecf4;box-shadow:0 8px 24px rgba(15,30,60,.07)\" srcset=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/modern-css-2026-fig.png 1200w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/modern-css-2026-fig-300x225.png 300w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/modern-css-2026-fig-1024x768.png 1024w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/modern-css-2026-fig-768x576.png 768w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/modern-css-2026-fig-800x600.png 800w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><figcaption style=\"margin-top:12px;font-size:13.5px;color:#7b8aa0;text-align:center;line-height:1.75\">\u73b0\u4ee3 CSS \u843d\u5730\u987a\u5e8f\uff1a\u7ea7\u8054\u5c42 \u2192 \u5bb9\u5668\u67e5\u8be2 \u2192 :has() \u2192 \u89c6\u56fe\u8fc7\u6e21 \u2192 \u951a\u70b9\u5b9a\u4f4d<\/figcaption><\/figure>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-1\">\u4e00\u3001\u5bb9\u5668\u67e5\u8be2\uff1a\u7ec4\u4ef6\u7ec8\u4e8e\u80fd\u81ea\u5df1\u51b3\u5b9a\u957f\u4ec0\u4e48\u6837<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5a92\u4f53\u67e5\u8be2\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@media<\/code>\uff09\u95ee\u7684\u662f&#8221;\u89c6\u53e3\u6709\u591a\u5bbd&#8221;\uff0c\u4f46\u7ec4\u4ef6\u771f\u6b63\u5173\u5fc3\u7684\u662f<strong style=\"color:#0f1c2e;font-weight:600\">&#8220;\u6211\u88ab\u653e\u8fdb\u4e86\u591a\u5927\u7684\u7a7a\u95f4&#8221;<\/strong>\u3002\u540c\u4e00\u4e2a\u5361\u7247\u7ec4\u4ef6\uff0c\u585e\u8fdb 320px \u7684\u4fa7\u680f\u548c\u585e\u8fdb 900px \u7684\u4e3b\u5185\u5bb9\u533a\uff0c\u672c\u6765\u5c31\u5e94\u8be5\u957f\u6210\u4e24\u4e2a\u6837\u5b50\u2014\u2014\u5728\u5bb9\u5668\u67e5\u8be2\u4e4b\u524d\uff0c\u8fd9\u4ef6\u4e8b\u53ea\u80fd\u9760 JS \u6d4b\u91cf\u6216\u8005\u7ed9\u7ec4\u4ef6\u4f20 size \u5c5e\u6027\u786c\u51d1\u3002<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">.card-container {\n  container-type: inline-size;\n}\n\n.card { \/* \u7a84\u5bb9\u5668\uff1a\u7eb5\u5411\u5806\u53e0 *\/ }\n\n@container (min-width: 480px) {\n  .card { \/* \u5bbd\u5bb9\u5668\uff1a\u5de6\u53f3\u5e03\u5c40 *\/ }\n}\n<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5173\u952e\u70b9\u662f <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">container-type: inline-size<\/code>\uff0c\u5b83\u628a\u8fd9\u4e2a\u5143\u7d20\u58f0\u660e\u4e3a\u4e00\u4e2a&#8221;\u53ef\u67e5\u8be2\u7684\u5bb9\u5668&#8221;\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u6ce8\u610f\u526f\u4f5c\u7528<\/strong>\uff1a\u58f0\u660e\u4e86 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">inline-size<\/code> \u7684\u5143\u7d20\uff0c\u5176\u884c\u5185\u5c3a\u5bf8\u4e0d\u518d\u53d7\u5185\u5bb9\u6491\u5f00\u5f71\u54cd\uff0c\u5e03\u5c40\u4e0a\u8981\u989d\u5916\u786e\u8ba4\u4e00\u904d\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u843d\u5730\u5efa\u8bae\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u4f18\u5148\u5728\u771f\u6b63\u4f1a\u88ab\u590d\u7528\u5230\u4e0d\u540c\u4f4d\u7f6e\u7684\u7ec4\u4ef6\u4e0a\u7528<\/strong>\uff08\u5361\u7247\u3001\u5217\u8868\u9879\u3001\u5de5\u5177\u680f\uff09\uff0c\u800c\u4e0d\u662f\u5168\u7ad9\u94fa\u5f00\u3002\u94fa\u5f00\u4e4b\u540e\u8c03\u8bd5\u6210\u672c\u4f1a\u660e\u663e\u4e0a\u5347\uff0c\u56e0\u4e3a\u4f60\u5f97\u4e00\u7ea7\u4e00\u7ea7\u5f80\u4e0a\u627e\u662f\u54ea\u4e2a\u5bb9\u5668\u5728\u751f\u6548\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-2\">\u4e8c\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has()<\/code>\uff1a\u7f3a\u5931\u4e86\u4e8c\u5341\u5e74\u7684\u7236\u9009\u62e9\u5668<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">&#8220;\u5982\u679c\u8fd9\u5f20\u5361\u7247\u91cc\u6709\u56fe\u7247\uff0c\u5c31\u6362\u4e00\u5957\u5185\u8fb9\u8ddd&#8221;\u2014\u2014\u8fd9\u7c7b\u9700\u6c42\u4ee5\u524d\u53ea\u80fd\u9760\u5728\u6a21\u677f\u5c42\u52a0 class\u3002<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has()<\/code> \u628a\u5b83\u53d8\u56de\u7eaf CSS\uff1a<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">.card:has(img) {\n  padding-top: 0;\n}\n\n\/* \u8868\u5355\u6821\u9a8c\u5931\u8d25\u7684\u5b57\u6bb5\uff0c\u9ad8\u4eae\u6574\u4e2a\u8868\u5355\u7ec4 *\/\n.form-group:has(:invalid) {\n  border-color: #d94f5c;\n}\n<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5b83\u7684\u4ef7\u503c\u4e0d\u53ea\u662f\u5c11\u5199 JS\uff0c\u800c\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u628a&#8221;\u7ed3\u6784\u5224\u65ad&#8221;\u8fd9\u4ef6\u4e8b\u653e\u56de\u4e86\u5b83\u8be5\u5728\u7684\u5730\u65b9<\/strong>\u3002\u6a21\u677f\u4e0d\u7528\u518d\u4e3a\u4e86\u6837\u5f0f\u53bb\u7ef4\u62a4\u4e00\u5806\u72b6\u6001 class\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u9700\u8981\u6ce8\u610f\u7684\u6027\u80fd\u8ba4\u77e5\uff1a\u65e9\u671f\u7684\u62c5\u5fe7\u662f <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has()<\/code> \u4f1a\u4e0d\u4f1a\u5f88\u6162\u3002\u5b9e\u9645\u5728\u73b0\u4ee3\u5f15\u64ce\u91cc\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u9650\u5b9a\u4f5c\u7528\u57df\u7684\u5199\u6cd5\uff08\u5982 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">.card:has(img)<\/code>\uff09\u5f00\u9500\u53ef\u63a5\u53d7<\/strong>\uff1b\u771f\u6b63\u8981\u907f\u514d\u7684\u662f\u65e0\u7ea6\u675f\u7684\u5168\u5c40\u5199\u6cd5\uff0c\u6bd4\u5982 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has(*)<\/code> \u8fd9\u7c7b\u628a\u6574\u68f5\u6811\u90fd\u7eb3\u5165\u5339\u914d\u7684\u6a21\u5f0f\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-3\">\u4e09\u3001\u7ea7\u8054\u5c42\uff1a\u628a !important \u6218\u4e89\u63d0\u524d\u7ec8\u7ed3<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5927\u578b\u9879\u76ee\u6837\u5f0f\u5931\u63a7\u7684\u5178\u578b\u8def\u5f84\u662f\uff1a\u7b2c\u4e09\u65b9\u5e93\u6837\u5f0f\u76d6\u4e0d\u4f4f \u2192 \u52a0 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">!important<\/code> \u2192 \u522b\u4eba\u518d\u52a0\u4e00\u5c42 \u2192 \u8c01\u4e5f\u4e0d\u6562\u5220\u3002<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@layer<\/code> \u63d0\u4f9b\u7684\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u5728\u5c42\u4e0e\u5c42\u4e4b\u95f4\u9884\u5148\u5b9a\u597d\u4f18\u5148\u7ea7<\/strong>\u7684\u673a\u5236\uff1a<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">@layer reset, vendor, components, utilities;\n\n@layer vendor     { @import url(\"some-lib.css\"); }\n@layer components { .btn { \/* ... *\/ } }\n@layer utilities  { .mt-4 { margin-top: 1rem; } }\n<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u58f0\u660e\u987a\u5e8f\u5373\u4f18\u5148\u7ea7\u987a\u5e8f\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u540e\u58f0\u660e\u7684\u5c42\u538b\u8fc7\u5148\u58f0\u660e\u7684\u5c42<\/strong>\uff0c\u4e14\u8fd9\u4e2a\u4f18\u5148\u7ea7\u9ad8\u4e8e\u9009\u62e9\u5668\u7279\u5f02\u6027\u3002\u8fd9\u610f\u5473\u7740 utilities \u5c42\u91cc\u7684\u4e00\u4e2a\u5355\u7c7b\u9009\u62e9\u5668\uff0c\u53ef\u4ee5\u7a33\u5b9a\u538b\u8fc7 components \u5c42\u91cc\u5f88\u957f\u7684\u540e\u4ee3\u9009\u62e9\u5668\u2014\u2014\u518d\u4e5f\u4e0d\u7528\u9760\u5806\u7c7b\u540d\u957f\u5ea6\u53d6\u80dc\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8fc1\u79fb\u6210\u672c\u5f88\u4f4e\uff1a\u628a\u73b0\u6709\u7684\u6837\u5f0f\u5206\u5757\u5305\u8fdb <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@layer<\/code> \u5373\u53ef\uff0c\u4e0d\u9700\u8981\u6539\u4efb\u4f55\u9009\u62e9\u5668\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u5efa\u8bae\u5728\u65b0\u9879\u76ee\u91cc\u7b2c\u4e00\u5929\u5c31\u5efa\u597d\u5c42\u7ed3\u6784<\/strong>\uff0c\u8001\u9879\u76ee\u5219\u53ef\u4ee5\u5728\u5f15\u5165\u65b0\u6a21\u5757\u65f6\u9010\u6b65\u6536\u655b\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-4\">\u56db\u3001\u89c6\u56fe\u8fc7\u6e21\uff1a\u58f0\u660e\u5f0f\u7684\u9875\u9762\u5207\u6362\u52a8\u753b<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5355\u9875\u5e94\u7528\u91cc\u7684\u8def\u7531\u5207\u6362\u52a8\u753b\uff0c\u4ee5\u524d\u610f\u5473\u7740\u4e00\u5806\u72b6\u6001\u7ba1\u7406\u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">requestAnimationFrame<\/code>\u3002\u89c6\u56fe\u8fc7\u6e21 API \u628a\u8fd9\u4ef6\u4e8b\u53d8\u6210\u4e86\u6d4f\u89c8\u5668\u539f\u751f\u80fd\u529b\uff1a<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">function navigate(to) {\n  if (!document.startViewTransition) {\n    updateDOM(to)          \/\/ \u4e0d\u652f\u6301\u5c31\u8001\u8001\u5b9e\u5b9e\u76f4\u63a5\u5207\n    return\n  }\n  document.startViewTransition(() =&gt; updateDOM(to))\n}\n<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u622a\u53d6\u5207\u6362\u524d\u540e\u7684\u4e24\u5e27\u505a\u4ea4\u53c9\u6de1\u5165\uff0c\u5143\u7d20\u53ea\u8981\u6807\u8bb0\u4e86 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">view-transition-name<\/code>\uff0c\u5c31\u80fd\u5728\u4e24\u4e2a\u72b6\u6001\u4e4b\u95f4\u81ea\u52a8\u505a\u4f4d\u7f6e\u548c\u5c3a\u5bf8\u8865\u95f4\u2014\u2014<strong style=\"color:#0f1c2e;font-weight:600\">\u5217\u8868\u9879\u70b9\u5f00\u53d8\u6210\u8be6\u60c5\u9875\u5927\u56fe<\/strong>\u8fd9\u79cd\u6548\u679c\uff0c\u51e0\u884c CSS \u5c31\u80fd\u5b9e\u73b0\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e24\u6761\u7ea2\u7ebf\uff1a\u4e00\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u5fc5\u987b\u505a\u7279\u6027\u68c0\u6d4b<\/strong>\uff0c\u4e0d\u652f\u6301\u7684\u73af\u5883\u8981\u80fd\u6b63\u5e38\u964d\u7ea7\uff1b\u4e8c\u662f\u8bb0\u5f97\u7167\u987e <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">prefers-reduced-motion<\/code>\uff0c\u5bf9\u524d\u5ead\u529f\u80fd\u654f\u611f\u7684\u7528\u6237\u76f4\u63a5\u5173\u6389\u8fc7\u6e21\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-5\">\u4e94\u3001\u8fd8\u6709\u51e0\u9879\u503c\u5f97\u6392\u8fdb\u6280\u672f\u96f7\u8fbe<\/h2>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">subgrid<\/code><\/strong>\uff1a\u8ba9\u5b50\u5143\u7d20\u7684\u7f51\u683c\u5bf9\u9f50\u7236\u7f51\u683c\u3002\u505a&#8221;\u591a\u884c\u5361\u7247\u5de6\u53f3\u5217\u5bf9\u9f50&#8221;\u8fd9\u79cd\u9700\u6c42\u65f6\uff0c\u7ec8\u4e8e\u4e0d\u7528\u7ed9\u6bcf\u4e2a\u5361\u7247\u585e\u6b7b\u9ad8\u5ea6\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u951a\u70b9\u5b9a\u4f4d\uff08Anchor Positioning\uff09<\/strong>\uff1a\u628a\u6d6e\u5c42\u7ed1\u5b9a\u5230\u89e6\u53d1\u5143\u7d20\uff0c\u4e0d\u7528\u518d\u624b\u52a8\u7b97\u5750\u6807\u3002Tooltip\u3001\u4e0b\u62c9\u83dc\u5355\u7684\u5473\u9053\u5f88\u5bf9\uff0c\u4f46\u517c\u5bb9\u6027\u8fd8\u5728\u94fa\uff0c\u5efa\u8bae\u5148\u505a\u6e10\u8fdb\u589e\u5f3a\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">oklch()<\/code> \u4e0e <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">color-mix()<\/code><\/strong>\uff1a perceptual \u5747\u5300\u7684\u8272\u5f69\u7a7a\u95f4\uff0c\u505a\u4e3b\u9898\u8272\u9636\u65f6\u6bd4 HSL \u9760\u8c31\u5f97\u591a\uff0c\u6df1\u6d45\u8272\u6a21\u5f0f\u4e0b\u7684\u5bf9\u6bd4\u5ea6\u4e5f\u66f4\u53ef\u9884\u671f\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u6eda\u52a8\u9a71\u52a8\u52a8\u753b<\/strong>\uff1a\u628a\u52a8\u753b\u8fdb\u5ea6\u7ed1\u5230\u6eda\u52a8\u4f4d\u7f6e\uff0c\u7eaf CSS \u5b9e\u73b0\uff0c\u4e0d\u518d\u9700\u8981 scroll \u4e8b\u4ef6\u76d1\u542c\u3002\u9605\u8bfb\u8fdb\u5ea6\u6761\u3001\u6eda\u52a8\u6e10\u663e\u8fd9\u7c7b\u6548\u679c\u7684\u6027\u4ef7\u6bd4\u6781\u9ad8\u3002<\/li>\n<\/ul>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-6\">\u516d\u3001\u843d\u5730\u987a\u5e8f\u5efa\u8bae<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e0d\u8981\u628a\u65b0\u7279\u6027\u4e00\u6b21\u6027\u5168\u4e0a\u3002\u6309&#8221;\u6536\u76ca \/ \u98ce\u9669&#8221;\u6392\uff0c\u6211\u7684\u5efa\u8bae\u987a\u5e8f\u662f\uff1a<\/p>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@layer<\/code><\/strong>\u2014\u2014\u51e0\u4e4e\u96f6\u98ce\u9669\uff0c\u7acb\u523b\u89e3\u51b3\u6837\u5f0f\u5931\u63a7\uff0c\u6536\u76ca\u7acb\u7aff\u89c1\u5f71\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5bb9\u5668\u67e5\u8be2<\/strong>\u2014\u2014\u89e3\u51b3\u771f\u5b9e\u75db\u70b9\uff0c\u4e14\u4e0d\u652f\u6301\u65f6\u4f1a\u4f18\u96c5\u9000\u56de\u57fa\u7840\u5e03\u5c40\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has()<\/code><\/strong>\u2014\u2014\u80fd\u5220\u6389\u4e00\u6279\u6a21\u677f\u5c42\u72b6\u6001\u903b\u8f91\uff0c\u5199\u6cd5\u6536\u655b\u540e\u5f88\u597d\u7ef4\u62a4\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u89c6\u56fe\u8fc7\u6e21<\/strong>\u2014\u2014\u4f53\u9a8c\u63d0\u5347\u6700\u76f4\u89c2\uff0c\u4f46\u4e00\u5b9a\u8981\u5199\u964d\u7ea7\u5206\u652f\uff1b<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u951a\u70b9\u5b9a\u4f4d \/ \u6eda\u52a8\u9a71\u52a8\u52a8\u753b<\/strong>\u2014\u2014\u5148\u5728\u975e\u5173\u952e\u8def\u5f84\u4e0a\u8bd5\uff0c\u7b49\u8986\u76d6\u9762\u66f4\u5e7f\u518d\u8fdb\u4e3b\u6d41\u7a0b\u3002<\/li>\n<\/ol>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #35b98a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-7\">\u4e03\u3001\u5c0f\u7ed3<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8fd9\u4e00\u8f6e CSS \u66f4\u65b0\u7684\u5171\u540c\u4e3b\u9898\uff0c\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u628a\u4ee5\u524d\u5fc5\u987b\u5199 JS \u624d\u80fd\u505a\u7684\u4e8b\uff0c\u6536\u56de\u5230\u6837\u5f0f\u5c42<\/strong>\u3002\u5bb9\u5668\u67e5\u8be2\u6536\u8d70\u4e86\u5c3a\u5bf8\u6d4b\u91cf\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">:has()<\/code> \u6536\u8d70\u4e86\u7ed3\u6784\u5224\u65ad\uff0c\u89c6\u56fe\u8fc7\u6e21\u6536\u8d70\u4e86\u52a8\u753b\u7f16\u6392\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@layer<\/code> \u6536\u8d70\u4e86\u4f18\u5148\u7ea7\u7ba1\u7406\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5bf9\u5de5\u7a0b\u7684\u5b9e\u9645\u5f71\u54cd\u662f\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u7ec4\u4ef6\u7684\u81ea\u6d3d\u6027\u53d8\u5f3a\u4e86<\/strong>\u3002\u4e00\u4e2a\u7ec4\u4ef6\u80fd\u4e0d\u80fd&#8221;\u653e\u54ea\u90fd\u957f\u5bf9&#8221;\uff0c\u4ee5\u524d\u53d6\u51b3\u4e8e\u4f7f\u7528\u65b9\u4f20\u6ca1\u4f20\u5bf9\u53c2\u6570\uff0c\u73b0\u5728\u53d6\u51b3\u4e8e\u5b83\u81ea\u5df1\u5199\u6ca1\u5199\u5bf9\u5bb9\u5668\u67e5\u8be2\u3002\u8fd9\u4e2a\u8f6c\u53d8\u503c\u5f97\u91cd\u65b0\u5ba1\u89c6\u4e00\u904d\u73b0\u6709\u7684\u7ec4\u4ef6\u5e93\u3002<\/p>\n<div style=\"margin:42px 0 0;padding:22px 0 0;border-top:1px solid #eaeef4\">\n<div style=\"font-size:13px;color:#93a1b5;letter-spacing:1px;margin-bottom:12px\">\u6807\u7b7e<\/div>\n<p><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#CSS<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u524d\u7aef<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u5bb9\u5668\u67e5\u8be2<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u54cd\u5e94\u5f0f\u8bbe\u8ba1<\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb9\u5668\u67e5\u8be2\u3001:has()\u3001\u7ea7\u8054\u5c42\u3001\u89c6\u56fe\u8fc7\u6e21\u3001\u951a\u70b9\u5b9a\u4f4d\u2014\u2014\u8fd9\u4e9b\u80fd\u529b\u5355\u72ec\u770b\u662f\u53c8\u4e00\u4e2a\u65b0\u5c5e\u6027\uff0c\u5408\u5728\u4e00\u8d77\u5374\u6539\u53d8\u4e86\u6837\u5f0f\u8868\u7684\u7ec4\u7ec7\u65b9\u5f0f\u3002\u672c\u6587\u53ea\u8bb2\u80fd\u5728\u751f\u4ea7\u843d\u5730\u7684\u90e8\u5206\uff1a\u6bcf\u9879\u89e3\u51b3\u4ec0\u4e48\u8001\u95ee\u9898\u3001\u4ee3\u7801\u600e\u4e48\u5199\u3001\u517c\u5bb9\u6027\u7ea2\u7ebf\u5728\u54ea\uff0c\u5e76\u7ed9\u51fa\u6309\u6536\u76ca\u98ce\u9669\u6392\u5e8f\u7684\u843d\u5730\u987a\u5e8f\u3002<\/p>\n","protected":false},"author":1,"featured_media":197,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,1],"tags":[86,85,88,87],"class_list":["post-199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-frontend","category-technical","tag-css","tag-85","tag-88","tag-87"],"_links":{"self":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":0,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media\/197"}],"wp:attachment":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}