{"id":12955,"date":"2026-07-01T10:03:20","date_gmt":"2026-07-01T01:03:20","guid":{"rendered":"https:\/\/code-plus.jp\/gp\/?p=12955"},"modified":"2026-07-01T10:41:37","modified_gmt":"2026-07-01T01:41:37","slug":"css-specificity-12955","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/css-specificity-12955\/","title":{"rendered":"CSS\u8a73\u7d30\u5ea6\u3092\u56f3\u89e3\u3059\u308b\uff1aIDs\u30fbclass\u30fbtype\u304b\u3089 :is() :where()\u307e\u3067"},"content":{"rendered":"<p>CSS\u304c\u300c\u601d\u3063\u305f\u901a\u308a\u306b\u4e0a\u66f8\u304d\u3055\u308c\u306a\u3044\u300d\u3068\u304d\u3001\u539f\u56e0\u306e\u591a\u304f\u306f\u8a73\u7d30\u5ea6\uff08specificity\uff09\u306e\u7406\u89e3\u4e0d\u8db3\u3067\u3059\u3002\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067 <code>:is()<\/code> \/ <code>:where()<\/code> \u3092\u4f7f\u3063\u305f\u8a73\u7d30\u5ea6\u8a2d\u8a08\u306e\u8a71\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u305d\u3082\u305d\u3082\u8a73\u7d30\u5ea6\u304c\u3069\u3046\u8a08\u7b97\u3055\u308c\u308b\u306e\u304b\u3092\u6574\u7406\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4eca\u56de\u306f\u56f3\u89e3\u4e2d\u5fc3\u306b\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\r\n\r\n<!-- \u2756\u76ee\u6b21\u30ea\u30b9\u30c8 -->\r\n<ul class=\"tocList mt-3r\" data-toc-id=\"js-tocBWGD\" style=\"height:17rem\"><\/ul>\r\n<ins class=\"tocBtn is-fixed\" data-toc-id=\"js-tocBWGD\"><\/ins>\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\">\u8a73\u7d30\u5ea6\u306f\u300c3\u3064\u306e\u6841\u300d\u3067\u3067\u304d\u3066\u3044\u308b<\/h2>\r\n<p>CSS\u306e\u8a73\u7d30\u5ea6\u306f\u3001\u3088\u304f\u70b9\u6570\u306e\u3088\u3046\u306b\u8a9e\u3089\u308c\u307e\u3059\u304c\u3001\u5b9f\u969b\u306f<b class=\"fw-600\">3\u3064\u306e\u72ec\u7acb\u3057\u305f\u6841<\/b>\u3092\u6301\u3064\u30ab\u30a6\u30f3\u30bf\u30fc\u3067\u3059\u3002<\/p>\r\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\r\n  <li>IDs\u306a<code>#header<\/code> \u306e\u3088\u3046\u306aID \u30bb\u30ec\u30af\u30bf\u306e\u6570<\/li>\r\n  <li>class\u30fb\u5c5e\u6027\u30fb\u7591\u4f3c\u30af\u30e9\u30b9\u306a<code>.btn<\/code>\u3001<code>[type=\"text\"]<\/code>\u3001<code>:hover<\/code> \u306a\u3069\u306e\u6570<\/li>\r\n  <li>type\u30fb\u7591\u4f3c\u8981\u7d20\u306a<code>div<\/code>\u3001<code>a<\/code>\u3001<code>::before<\/code> \u306a\u3069\u306e\u6570<\/li>\r\n<\/ul>\r\n<p>\u4e0b\u306e\u56f3\u306e\u3088\u3046\u306b\u3001\u3053\u308c\u306f(IDs, class\u7b49, type\u7b49)\u3068\u3044\u30463\u3064\u306e\u6841\u306e\u7d44\u3067\u8868\u3055\u308c\u307e\u3059\u3002<\/p>\r\n\r\n<div class=\"chest-wrapper mt-1r\">\r\n  <svg width=\"100%\" viewBox=\"0 0 680 260\" role=\"img\">\r\n    <title>\u8a73\u7d30\u5ea63\u8981\u7d20\u306e\u91cd\u307f\u6bd4\u8f03\u56f3<\/title>\r\n    <desc>ID\u30fbclass\/\u5c5e\u6027\/\u7591\u4f3c\u30af\u30e9\u30b9\u30fbtype\/\u7591\u4f3c\u8981\u7d20\u306e3\u3064\u306e\u8981\u7d20\u304c\u3001\u8a73\u7d30\u5ea6\u306e\u8a08\u7b97\u3067\u305d\u308c\u305e\u308c\u72ec\u7acb\u3057\u305f\u6841\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3053\u3068\u3092\u793a\u3059\u56f3<\/desc>\r\n    <defs>\r\n      <marker id=\"arrowA\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"6\" markerHeight=\"6\" orient=\"auto-start-reverse\">\r\n        <path d=\"M2 1L8 5L2 9\" fill=\"none\" stroke=\"#73726c\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\r\n      <\/marker>\r\n    <\/defs>\r\n    <rect x=\"40\" y=\"30\" width=\"180\" height=\"56\" rx=\"8\" fill=\"#F5C4B3\" stroke=\"#993C1D\" stroke-width=\"0.5\" \/>\r\n    <text x=\"130\" y=\"52\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#4A1B0C\">IDs<\/text>\r\n    <text x=\"130\" y=\"72\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">#header<\/text>\r\n    <rect x=\"250\" y=\"30\" width=\"180\" height=\"56\" rx=\"8\" fill=\"#CECBF6\" stroke=\"#534AB7\" stroke-width=\"0.5\" \/>\r\n    <text x=\"340\" y=\"52\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#26215C\">class\u5c5e\u6027\u7591\u4f3c\u30af\u30e9\u30b9<\/text>\r\n    <text x=\"340\" y=\"72\" font-size=\"12\" text-anchor=\"middle\" fill=\"#3C3489\">.btn &lsqb;type&rsqb; :hover<\/text>\r\n    <rect x=\"460\" y=\"30\" width=\"180\" height=\"56\" rx=\"8\" fill=\"#9FE1CB\" stroke=\"#0F6E56\" stroke-width=\"0.5\" \/>\r\n    <text x=\"550\" y=\"52\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#04342C\">type\u7591\u4f3c\u8981\u7d20<\/text>\r\n    <text x=\"550\" y=\"72\" font-size=\"12\" text-anchor=\"middle\" fill=\"#085041\">div ::before<\/text>\r\n    <text x=\"130\" y=\"106\" font-size=\"12\" text-anchor=\"middle\" fill=\"#73726c\">(1,0,0)<\/text>\r\n    <text x=\"340\" y=\"106\" font-size=\"12\" text-anchor=\"middle\" fill=\"#73726c\">(0,1,0)<\/text>\r\n    <text x=\"550\" y=\"106\" font-size=\"12\" text-anchor=\"middle\" fill=\"#73726c\">(0,0,1)<\/text>\r\n    <line x1=\"220\" y1=\"58\" x2=\"248\" y2=\"58\" stroke=\"#73726c\" stroke-width=\"1.5\" marker-end=\"url(#arrowA)\" \/>\r\n    <text x=\"234\" y=\"44\" font-size=\"12\" text-anchor=\"middle\" fill=\"#73726c\">&gt;<\/text>\r\n    <line x1=\"430\" y1=\"58\" x2=\"458\" y2=\"58\" stroke=\"#73726c\" stroke-width=\"1.5\" marker-end=\"url(#arrowA)\" \/>\r\n    <text x=\"444\" y=\"44\" font-size=\"12\" text-anchor=\"middle\" fill=\"#73726c\">&gt;<\/text>\r\n    <text x=\"340\" y=\"140\" font-size=\"12\" text-anchor=\"middle\" fill=\"#3d3d3a\">\u3069\u308c\u3060\u3051\u96c6\u3081\u3066\u3082\u3001\u4e0a\u306e\u6841\u30921\u3064\u3082\u8d85\u3048\u3089\u308c\u306a\u3044<\/text>\r\n    <rect x=\"40\" y=\"170\" width=\"600\" height=\"70\" rx=\"8\" fill=\"#F1EFE8\" stroke=\"#5F5E5A\" stroke-width=\"0.5\" \/>\r\n    <text x=\"60\" y=\"194\" font-size=\"14\" font-weight=\"500\" fill=\"#2C2C2A\">\u4f8b: .a.b.c.d.e.f.g.h.i.j\uff08class 10\u500b\uff09\u3067\u3082<\/text>\r\n    <text x=\"60\" y=\"216\" font-size=\"14\" font-weight=\"500\" fill=\"#2C2C2A\">#id\uff08ID 1\u500b\uff09\u306b\u306f\u7d76\u5bfe\u306b\u52dd\u3066\u306a\u3044<\/text>\r\n  <\/svg>\r\n<\/div><!-- \/\/\/.chest -->\r\n\r\n<p>\u91cd\u8981\u306a\u306e\u306f\u3001\u3053\u308c\u304c\u300c\u70b9\u6570\u306e\u5408\u8a08\u300d\u3067\u306f\u306a\u304f<b class=\"fw-600\">\u6841\u4e0a\u304c\u308a\u3057\u306a\u30443\u9032\u6570\u306e\u3088\u3046\u306a\u3082\u306e<\/b>\u3060\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002class \u30bb\u30ec\u30af\u30bf\u3092\u3069\u308c\u3060\u3051\u4e26\u3079\u3066\u3082\u3001ID 1\u500b\u306b\u306f\u7d76\u5bfe\u306b\u52dd\u3066\u307e\u305b\u3093\u3002<code>.a.b.c.d.e.f.g.h.i.j<\/code>\uff08class 10\u500b = (0,10,0)\uff09\u3068 <code>#id<\/code>\uff08(1,0,0)\uff09\u3092\u6bd4\u3079\u308b\u3068\u3001\u4e0a\u306e\u6841\u3067\u3042\u308bIDs\u306e\u65b9\u304c\u5e38\u306b\u512a\u5148\u3055\u308c\u308b\u305f\u3081\u3001<code>#id<\/code> \u304c\u52dd\u3061\u307e\u3059\u3002<\/p>\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\">\u30bb\u30ec\u30af\u30bf\u4f8b\u3068\u8a73\u7d30\u5ea6\u306e\u65e9\u898b\u8868<\/h2>\r\n<p>\u4ee3\u8868\u7684\u306a\u30bb\u30ec\u30af\u30bf\u306e\u8a73\u7d30\u5ea6\u3092\u307e\u3068\u3081\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\r\n<table class=\"table my-0.5r\">\r\n  <thead>\r\n    <tr class=\"rung\">\r\n      <th>\u30bb\u30ec\u30af\u30bf\u4f8b<\/th>\r\n      <td>\u8a73\u7d30\u5ea6 (IDs, class\u7b49, type\u7b49)<\/td>\r\n      <td>\u5099\u8003<\/td>\r\n    <\/tr>\r\n  <\/thead>\r\n  <tbody>\r\n    <tr class=\"rung\">\r\n      <th><code>div<\/code><\/th>\r\n      <td>(0,0,1)<\/td>\r\n      <td>type\u5358\u4f53<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>.button<\/code><\/th>\r\n      <td>(0,1,0)<\/td>\r\n      <td>class\u5358\u4f53<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>#header<\/code><\/th>\r\n      <td>(1,0,0)<\/td>\r\n      <td>ID\u5358\u4f53<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>[type=\"button\"]<\/code><\/th>\r\n      <td>(0,1,0)<\/td>\r\n      <td>\u5c5e\u6027\u30bb\u30ec\u30af\u30bf\u306fclass\u3068\u540c\u683c<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>a:hover<\/code><\/th>\r\n      <td>(0,1,1)<\/td>\r\n      <td>\u7591\u4f3c\u30af\u30e9\u30b9\u306fclass\u3068\u540c\u683c<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>div::before<\/code><\/th>\r\n      <td>(0,0,2)<\/td>\r\n      <td>\u7591\u4f3c\u8981\u7d20\u306ftype\u3068\u540c\u683c<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>.button.is-active<\/code><\/th>\r\n      <td>(0,2,0)<\/td>\r\n      <td>class\u306e\u6570\u3060\u3051\u52a0\u7b97<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><code>#header .nav a<\/code><\/th>\r\n      <td>(1,1,1)<\/td>\r\n      <td>\u5b50\u5b6b\u3059\u3079\u3066\u5408\u7b97<\/td>\r\n    <\/tr>\r\n  <\/tbody>\r\n<\/table>\r\n<p><code>!important<\/code> \u306f\u3053\u306e3\u3064\u306e\u6841\u306e\u5916\u5074\u306b\u3042\u308b\u300c\u6700\u5f37\u306e\u4e0a\u66f8\u304d\u300d\u3067\u3001\u8a73\u7d30\u5ea6\u306e\u8a08\u7b97\u30eb\u30fc\u30eb\u81ea\u4f53\u306f\u5909\u3048\u307e\u305b\u3093\u3002\u8a73\u7d30\u5ea6\u3067\u52dd\u3066\u306a\u3044\u5834\u5408\u306e\u6700\u7d42\u624b\u6bb5\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002<\/p>\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\"><code>:is()<\/code> \/ <code>:not()<\/code> \/ <code>:has()<\/code> \/ <code>:where()<\/code> \u306e\u6319\u52d5\u306e\u9055\u3044<\/h2>\r\n<p>\u30e2\u30c0\u30f3CSS\u3067\u3088\u304f\u4f7f\u30464\u3064\u306e\u7591\u4f3c\u30af\u30e9\u30b9\u95a2\u6570\u306f\u3001\u8a73\u7d30\u5ea6\u306e\u6271\u308f\u308c\u65b9\u304c\u305d\u308c\u305e\u308c\u7570\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u6df7\u540c\u3059\u308b\u3068\u3001\u300c<code>:where()<\/code>\u3067\u5305\u3093\u3060\u306e\u306b\u8a73\u7d30\u5ea6\u304c\u5897\u3048\u3066\u3057\u307e\u3063\u305f\u300d\u306e\u3088\u3046\u306a\u4e8b\u6545\u306b\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/p>\r\n\r\n<div class=\"chest-wrapper mt-1r\">\r\n  <svg width=\"100%\" viewBox=\"0 0 680 400\" role=\"img\">\r\n    <title>:is() :not() :has() :where() \u306e\u8a73\u7d30\u5ea6\u6bd4\u8f03\u56f3<\/title>\r\n    <desc>4\u3064\u306e\u7591\u4f3c\u30af\u30e9\u30b9\u95a2\u6570\u304c\u3001\u5185\u5074\u306e\u30bb\u30ec\u30af\u30bf\u30ea\u30b9\u30c8\u306e\u8a73\u7d30\u5ea6\u3092\u3069\u3046\u5916\u5074\u306b\u53cd\u6620\u3059\u308b\u304b\u3092\u793a\u3059\u56f3\u3002:is()\u3068:not()\u3068:has()\u306f\u5185\u5074\u3067\u6700\u3082\u8a73\u7d30\u5ea6\u304c\u9ad8\u3044\u3082\u306e\u3092\u63a1\u7528\u3057\u3001:where()\u306f\u5e38\u306b0\u306b\u306a\u308b<\/desc>\r\n    <rect x=\"40\" y=\"30\" width=\"280\" height=\"80\" rx=\"10\" fill=\"#F5C4B3\" stroke=\"#993C1D\" stroke-width=\"0.5\" \/>\r\n    <text x=\"180\" y=\"56\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#4A1B0C\">:is(.a, #b, span)<\/text>\r\n    <text x=\"180\" y=\"76\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">\u5185\u5074\u3067\u6700\u3082\u9ad8\u3044\u8a73\u7d30\u5ea6\u3092\u63a1\u7528<\/text>\r\n    <text x=\"180\" y=\"94\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">\u3053\u306e\u4f8b\u306a\u3089 #b \u306e (1,0,0)<\/text>\r\n    <rect x=\"360\" y=\"30\" width=\"280\" height=\"80\" rx=\"10\" fill=\"#F5C4B3\" stroke=\"#993C1D\" stroke-width=\"0.5\" \/>\r\n    <text x=\"500\" y=\"56\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#4A1B0C\">:not(.a, #b, span)<\/text>\r\n    <text x=\"500\" y=\"76\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">:is()\u3068\u540c\u3058\u63a1\u7528\u30eb\u30fc\u30eb<\/text>\r\n    <text x=\"500\" y=\"94\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">\u3053\u306e\u4f8b\u306a\u3089 #b \u306e (1,0,0)<\/text>\r\n    <rect x=\"40\" y=\"130\" width=\"280\" height=\"80\" rx=\"10\" fill=\"#F5C4B3\" stroke=\"#993C1D\" stroke-width=\"0.5\" \/>\r\n    <text x=\"180\" y=\"156\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#4A1B0C\">:has(.a, #b, span)<\/text>\r\n    <text x=\"180\" y=\"176\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">:is()\u3068\u540c\u3058\u63a1\u7528\u30eb\u30fc\u30eb<\/text>\r\n    <text x=\"180\" y=\"194\" font-size=\"12\" text-anchor=\"middle\" fill=\"#712B13\">\u3053\u306e\u4f8b\u306a\u3089 #b \u306e (1,0,0)<\/text>\r\n    <rect x=\"360\" y=\"130\" width=\"280\" height=\"80\" rx=\"10\" fill=\"#9FE1CB\" stroke=\"#0F6E56\" stroke-width=\"0.5\" \/>\r\n    <text x=\"500\" y=\"156\" font-size=\"14\" font-weight=\"500\" text-anchor=\"middle\" fill=\"#04342C\">:where(.a, #b, span)<\/text>\r\n    <text x=\"500\" y=\"176\" font-size=\"12\" text-anchor=\"middle\" fill=\"#085041\">\u4e2d\u8eab\u306b\u95a2\u4fc2\u306a\u304f\u5e38\u306b0<\/text>\r\n    <text x=\"500\" y=\"194\" font-size=\"12\" text-anchor=\"middle\" fill=\"#085041\">(0,0,0) \u56fa\u5b9a<\/text>\r\n    <rect x=\"40\" y=\"250\" width=\"600\" height=\"130\" rx=\"8\" fill=\"#F1EFE8\" stroke=\"#5F5E5A\" stroke-width=\"0.5\" \/>\r\n    <text x=\"60\" y=\"278\" font-size=\"14\" font-weight=\"500\" fill=\"#2C2C2A\">\u4f7f\u3044\u5206\u3051\u306e\u76ee\u5b89<\/text>\r\n    <text x=\"60\" y=\"302\" font-size=\"12\" fill=\"#444441\">:is() \/ :not() \/ :has() \u2192 \u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3057\u3064\u3064\u8a73\u7d30\u5ea6\u3082\u6301\u305f\u305b\u305f\u3044\u6642<\/text>\r\n    <text x=\"60\" y=\"324\" font-size=\"12\" fill=\"#444441\">:where() \u2192 \u8a73\u7d30\u5ea6\u3092\u5897\u3084\u3055\u305a\u306b\u30bb\u30ec\u30af\u30bf\u3092\u307e\u3068\u3081\u305f\u3044\u30fb<\/text>\r\n    <text x=\"60\" y=\"344\" font-size=\"12\" fill=\"#444441\">\u3000\u3042\u3068\u304b\u3089\u4e0a\u66f8\u304d\u3057\u3084\u3059\u304f\u3057\u3066\u304a\u304d\u305f\u3044\u6642<\/text>\r\n    <text x=\"60\" y=\"366\" font-size=\"12\" fill=\"#444441\">@scope(.theme-name) \u3082\u5b9f\u8cea :where(.theme-name) \u3068\u540c\u3058\u8a73\u7d30\u5ea60<\/text>\r\n  <\/svg>\r\n<\/div><!-- \/\/\/.chest -->\r\n\r\n<p>\u30dd\u30a4\u30f3\u30c8\u306f\u3001<b class=\"fw-600\"><code>:is()<\/code> <code>:not()<\/code> <code>:has()<\/code> \u306e3\u3064\u306f\u300c\u5185\u5074\u306e\u30bb\u30ec\u30af\u30bf\u30ea\u30b9\u30c8\u306e\u3046\u3061\u6700\u3082\u8a73\u7d30\u5ea6\u304c\u9ad8\u3044\u3082\u306e\u300d\u304c\u305d\u306e\u307e\u307e\u5916\u5074\u306e\u8a73\u7d30\u5ea6\u3068\u3057\u3066\u63a1\u7528\u3055\u308c\u308b<\/b>\u306e\u306b\u5bfe\u3057\u3001<b class=\"fw-600\"><code>:where()<\/code> \u3060\u3051\u306f\u4e2d\u8eab\u306b\u95a2\u4fc2\u306a\u304f\u5e38\u306b\u8a73\u7d30\u5ea60\u3068\u3057\u3066\u6271\u308f\u308c\u308b<\/b>\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<code>:where(#header)<\/code> \u306e\u3088\u3046\u306bID\u3092\u5165\u308c\u3066\u3082\u3001\u8a73\u7d30\u5ea6\u306f0\u306e\u307e\u307e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\r\n<p><code>@scope(.theme-name) { ... }<\/code> \u3082\u3001\u30b9\u30b3\u30fc\u30d7\u306e\u8d77\u70b9\u3092\u6307\u5b9a\u3059\u308b\u90e8\u5206\u81ea\u4f53\u306e\u8a73\u7d30\u5ea6\u306f <code>:where()<\/code> \u76f8\u5f53\uff080\uff09\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002\u30b9\u30b3\u30fc\u30d7\u306b\u3088\u308b\u5f71\u97ff\u7bc4\u56f2\u306e\u9650\u5b9a\u3068\u3044\u3046\u5225\u306e\u5229\u70b9\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u8a73\u7d30\u5ea6\u306e\u6587\u8108\u3067\u306f <code>:where(.theme-name)<\/code> \u3068\u307b\u307c\u540c\u3058\u6319\u52d5\u3068\u8003\u3048\u3066\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\">\u6570\u5024\u306b\u306f\u73fe\u308c\u306a\u3044\u4f8b\u5916\u305f\u3061<\/h2>\r\n<p>\u3053\u3053\u307e\u3067\u306e\u6570\u5024\u8a08\u7b97\u3068\u306f\u5225\u306b\u3001\u5b9f\u52d9\u3067\u3064\u307e\u305a\u304d\u3084\u3059\u3044\u4f8b\u5916\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002<\/p>\r\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\r\n  <li><code>:lang()<\/code> <code>:hover<\/code> <code>:focus<\/code> <code>:placeholder-shown<\/code> \u306a\u3069\u306e\u7591\u4f3c\u30af\u30e9\u30b9\u306a\u901a\u5e38\u306e\u7591\u4f3c\u30af\u30e9\u30b9\u3068\u540c\u69d8\u306bclass\u7b49\u306e\u6841(0,1,0)\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u304c\u3001\u300c\u30ea\u30bb\u30c3\u30c8CSS\u306e\u4e2d\u306b\u7d1b\u308c\u8fbc\u3093\u3067\u3044\u308b\u300d\u3068\u898b\u843d\u3068\u3057\u3084\u3059\u304f\u3001\u60f3\u5b9a\u3088\u308a\u8a73\u7d30\u5ea6\u304c\u9ad8\u304f\u306a\u308b\u539f\u56e0\u306b\u306a\u308a\u304c\u3061\u3067\u3059<\/li>\r\n  <li><code>:nth-child()<\/code> <code>:nth-of-type()<\/code> \u306a\u3069\u306enth\u7cfb\u7591\u4f3c\u30af\u30e9\u30b9\u306a\u3053\u308c\u3082(0,1,0)\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u304c\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u5883\u754c\u6761\u4ef6\u3092\u6307\u5b9a\u3059\u308b\u5834\u9762\u3067\u591a\u7528\u3057\u3084\u3059\u304f\u3001\u6c17\u3065\u304b\u306a\u3044\u3046\u3061\u306b\u8a73\u7d30\u5ea6\u304c\u7a4d\u307f\u4e0a\u304c\u3063\u3066\u3044\u304d\u307e\u3059<\/li>\r\n  <li><code>::before<\/code> <code>::after<\/code> \u306a\u3069\u306e\u7591\u4f3c\u8981\u7d20\u306atype\u7b49\u306e\u6841(0,0,1)\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u3001<code>.box::before<\/code> \u306e\u3088\u3046\u306a\u5f62\u3067\u5730\u5473\u306b\u8a73\u7d30\u5ea6\u3092\u62bc\u3057\u4e0a\u3052\u307e\u3059<\/li>\r\n  <li>\u30a4\u30f3\u30e9\u30a4\u30f3\u30b9\u30bf\u30a4\u30eb\uff08<code>style=\"...\"<\/code>\uff09\u306aIDs\u3088\u308a\u3055\u3089\u306b\u5f37\u3044\u3001\u5225\u683c\u306e\u512a\u5148\u5ea6\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\uff08\u8a73\u7d30\u5ea6\u306e3\u6841\u306e\u5916\u5074\u306b\u3042\u308b\u7b2c0\u306e\u6841\u3001\u3068\u6349\u3048\u308b\u3068\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3059\uff09<\/li>\r\n<\/ul>\r\n<p>\u3053\u308c\u3089\u306f1\u30641\u3064\u306e\u5f71\u97ff\u306f\u5c0f\u3055\u3044\u3082\u306e\u306e\u3001\u30ea\u30bb\u30c3\u30c8CSS\u3084\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u7a4d\u307f\u91cd\u306a\u308b\u3068\u3001\u60f3\u5b9a\u5916\u306e\u5834\u6240\u3067\u8a73\u7d30\u5ea6\u304c\u5d29\u308c\u308b\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\">CSS\u30bb\u30ec\u30af\u30bf \u8a73\u7d30\u5ea6\u8a08\u7b97\u30c4\u30fc\u30eb<\/h2>\r\n<p>\u8a73\u7d30\u5ea6\u306f\u3001\u8a08\u7b97\u30c4\u30fc\u30eb\u7b49\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\r\n\r\n<a href=\"https:\/\/code-plus.jp\/gp\/tools\/specificity-calculator\/\" class=\"linkbox my-1.5r\">\r\n<h4 class=\"linkbox-title fz-md\">CSS\u30bb\u30ec\u30af\u30bf \u8a73\u7d30\u5ea6\u8a08\u7b97\u30c4\u30fc\u30eb<\/h4>\r\n<picture class=\"linkbox-thumbnail\">\r\n<img decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/code-plus.jp\/gp\/wp-content\/uploads\/5dcb88a5630b287acca386f5efe6c857.jpg?ver=20260701104137\" alt=\"CSS\u30bb\u30ec\u30af\u30bf \u8a73\u7d30\u5ea6\u8a08\u7b97\u30c4\u30fc\u30eb\" loading=\"lazy\" \/>\r\n<\/picture>\r\n<span class=\"linkbox-excerpt\">CSS\u30bb\u30ec\u30af\u30bf\u306e\u8a73\u7d30\u5ea6\uff08Specificity\uff09\u3092\u8a08\u7b97\u3059\u308b\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3002\u8907\u6570\u30bb\u30ec\u30af\u30bf\u3092\u4e00\u62ec\u8a08\u7b97\u3002:is() \/ :not() \/ :has() \/ :where() \/ :nth-child(n of S) \u306b\u5bfe\u5fdc\u3002\r\n&emsp;<u class=\"linkbox-more\">\u7d9a\u304d\u3092\u8aad\u3080<\/u>\r\n<\/span>\r\n<\/a>\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\">\u307e\u3068\u3081<\/h2>\r\n<p>\u8a73\u7d30\u5ea6\u306f\u300c3\u3064\u306e\u6841\u306e\u30ab\u30a6\u30f3\u30bf\u30fc\u300d\u3068\u3044\u3046\u30b7\u30f3\u30d7\u30eb\u306a\u4ed5\u7d44\u307f\u3067\u3059\u304c\u3001<code>:is()<\/code> \u7cfb\u3068 <code>:where()<\/code> \u306e\u9055\u3044\u306e\u3088\u3046\u306b\u3001\u30e2\u30c0\u30f3\u306a\u30bb\u30ec\u30af\u30bf\u95a2\u6570\u304c\u7d61\u3080\u3068\u4e00\u6c17\u306b\u8907\u96d1\u306b\u898b\u3048\u3066\u304d\u307e\u3059\u3002\u57fa\u672c\u306eIDs\u30fbclass\u7b49\u30fbtype\u7b49\u306e3\u6841\u3055\u3048\u62bc\u3055\u3048\u3066\u304a\u3051\u3070\u3001<code>:is()<\/code> \u306f\u300c\u4e2d\u8eab\u306e\u6700\u5927\u5024\u3092\u5f15\u304d\u7d99\u3050\u300d\u3001<code>:where()<\/code> \u306f\u300c\u5e38\u306b0\u300d\u3068\u3044\u30462\u3064\u306e\u30eb\u30fc\u30eb\u3092\u8db3\u3059\u3060\u3051\u3067\u3001\u307b\u3068\u3093\u3069\u306e\u30b1\u30fc\u30b9\u306f\u8aac\u660e\u304c\u3064\u304d\u307e\u3059\u3002<\/p>\r\n<p>\u3053\u308c\u307e\u3067\u306e3\u8a18\u4e8b\u3092\u901a\u3057\u3066\u3001CSS Layers\u3092\u8ae6\u3081\u305f\u7d4c\u7def\u304b\u3089\u3001ITCSS\/FLOCSS\u3092\u30d9\u30fc\u30b9\u306b\u3057\u305f\u30ec\u30a4\u30e4\u30fc\u8a2d\u8a08\u3001\u305d\u3057\u3066\u4eca\u56de\u306e\u8a73\u7d30\u5ea6\u306e\u57fa\u790e\u307e\u3067\u4e00\u901a\u308a\u6574\u7406\u3057\u307e\u3057\u305f\u3002\u5b9f\u969b\u306b\u3053\u306e\u8a73\u7d30\u5ea6\u8a2d\u8a08\u3092\u3069\u3046\u904b\u7528\u3057\u3066\u3044\u308b\u304b\u306f\u3001\u904e\u53bb\u8a18\u4e8b\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5b9f\u88c5\u4f8b\u3082\u5408\u308f\u305b\u3066\u8aad\u3093\u3067\u3082\u3089\u3048\u308b\u3068\u3001\u3088\u308a\u5177\u4f53\u7684\u306b\u30a4\u30e1\u30fc\u30b8\u3057\u3084\u3059\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<hr class=\"separator mx-auto mt-3r\" \/>\r\n\r\n<h2 class=\"fz-xl\">\u95a2\u9023\u8a18\u4e8b<\/h2>\r\n\r\n<a href=\"https:\/\/code-plus.jp\/gp\/itcss-flocss-12943\/\" class=\"linkbox my-1.5r\">\r\n<h4 class=\"linkbox-title fz-md\">CSS\u8a2d\u8a08\uff5cITCSS\u00d7FLOCSS\u306e\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u69cb\u6210\u3068\u8a73\u7d30\u5ea6\u8a2d\u8a08\u306e\u5b9f\u4f8b<\/h4>\r\n<picture class=\"linkbox-thumbnail\">\r\n<img decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/code-plus.jp\/gp\/wp-content\/uploads\/2f493ab51e39496ea178891a222741a5.jpg?ver=20260701104137\" alt=\"CSS\u8a2d\u8a08\uff5cITCSS\u00d7FLOCSS\u306e\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u69cb\u6210\u3068\u8a73\u7d30\u5ea6\u8a2d\u8a08\u306e\u5b9f\u4f8b\" loading=\"lazy\" \/>\r\n<\/picture>\r\n<span class=\"linkbox-excerpt\">ITCSS\u3068FLOCSS\u306f\u3069\u3061\u3089\u3082CSS\u8a2d\u8a08\u306e\u4ee3\u8868\u7684\u306a\u624b\u6cd5\u3067\u3059\u304c\u3001\u6027\u8cea\u3082\u5f97\u610f\u5206\u91ce\u3082\u7570\u306a\u308a\u307e\u3059\u3002\u4e21\u8005\u306e\u9055\u3044\u3092\u6574\u7406\u3057\u3064\u3064\u3001\u8272\u30c8\u30fc\u30af\u30f3\u7cfb\u30d5\u30a1\u30a4\u30eb\u306e\u7f6e\u304d\u5834\u306b\u8ff7\u3063\u305f\u5b9f\u4f8b\u3084\u3001`:is()` \/ `:where()` \u3092\u4f7f\u3063\u3066\u8a73\u7d30\u5ea6\u3092\u56fa\u5b9a\u3059\u308b6\u5c64\u69cb\u6210\u306e\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u8a2d\u8a08\u3092\u7d39\u4ecb...\r\n&emsp;<u class=\"linkbox-more\">\u7d9a\u304d\u3092\u8aad\u3080<\/u>\r\n<\/span>\r\n<\/a>\r\n\r\n<a href=\"https:\/\/code-plus.jp\/gp\/nth-of-type-12913\/\" class=\"linkbox my-1.5r\">\r\n<h4 class=\"linkbox-title fz-md\">CSS\u3067\u300c\u4f55\u756a\u76ee\u304b\u300d\u3092\u6307\u5b9a\u3059\u308b\uff1anth\u7cfb\u30bb\u30ec\u30af\u30bf\u3068\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u4f4d\u7f6e\u9078\u629e\u306e\u5b8c\u5168\u30ac\u30a4\u30c9<\/h4>\r\n<picture class=\"linkbox-thumbnail\">\r\n<img decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/code-plus.jp\/gp\/wp-content\/uploads\/ec7482348bf095c3682cdeabd5682bad.jpg?ver=20260701104137\" alt=\"CSS\u3067\u300c\u4f55\u756a\u76ee\u304b\u300d\u3092\u6307\u5b9a\u3059\u308b\uff1anth\u7cfb\u30bb\u30ec\u30af\u30bf\u3068\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u4f4d\u7f6e\u9078\u629e\u306e\u5b8c\u5168\u30ac\u30a4\u30c9\" loading=\"lazy\" \/>\r\n<\/picture>\r\n<span class=\"linkbox-excerpt\">\uff1anth-of-type\u30fb:nth-last-of-type \u306e\u5f0f\u306e\u8aad\u307f\u65b9\u304b\u3089\u3001:is() \/ :not() \/ :has() \u3092\u4f7f\u3063\u305f\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u4f4d\u7f6e\u9078\u629e\u307e\u3067\u7db2\u7f85\u3002\u300c\u6700\u521d\u3068\u6700\u5f8c\u4ee5\u5916\u300d\u306e\u8907\u6570\u306e\u66f8\u304d\u65b9\u3068\u8a73\u7d30\u5ea6\u306e\u6bd4\u8f03\u3082\u53ce\u9332\u3002CSS\u8a2d\u8a08\u306e\u5b9f\u52d9\u306b\u5f79\u7acb\u3064\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\r\n&emsp;<u class=\"linkbox-more\">\u7d9a\u304d\u3092\u8aad\u3080<\/u>\r\n<\/span>\r\n<\/a>\r\n\r\n<a href=\"https:\/\/code-plus.jp\/gp\/css-layers-9573\/\" class=\"linkbox my-1.5r\">\r\n<h4 class=\"linkbox-title fz-md\">CSS Layers\u306e\u4f7f\u3044\u65b9\u3068\u6ce8\u610f\u70b9 - \u5b9f\u969b\u306b\u4f7f\u3063\u3066\u5206\u304b\u3063\u305f\u554f\u984c\u70b9<\/h4>\r\n<picture class=\"linkbox-thumbnail\">\r\n<img decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/code-plus.jp\/gp\/wp-content\/uploads\/CSS-Laye_2510241009.jpg?ver=20260701104137\" alt=\"CSS Layers\u306e\u4f7f\u3044\u65b9\u3068\u6ce8\u610f\u70b9 - \u5b9f\u969b\u306b\u4f7f\u3063\u3066\u5206\u304b\u3063\u305f\u554f\u984c\u70b9\" loading=\"lazy\" \/>\r\n<\/picture>\r\n<span class=\"linkbox-excerpt\">CSS Layers\u306f\u8a73\u7d30\u5ea6\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u5f37\u529b\u306a\u4ed5\u7d44\u307f\u3067\u3059\u304c\u3001\u30d7\u30e9\u30b0\u30a4\u30f3CSS\u3068\u306e\u5171\u5b58\u306b\u5927\u304d\u306a\u58c1\u304c\u3042\u308a\u307e\u3059\u3002\u5b9f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u76f4\u9762\u3057\u305f\u554f\u984c\u70b9\u3068\u3001:is() \/ :where() \u3092\u4f7f\u3063\u305f\u8a73\u7d30\u5ea6\u8a2d\u8a08\u3068\u3044\u3046\u4ee3\u66ff\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u5b9f\u4f8b\u3064\u304d\u3067\u89e3\u8aac\u3057\u307e\u3059\u3002\r\n&emsp;<u class=\"linkbox-more\">\u7d9a\u304d\u3092\u8aad\u3080<\/u>\r\n<\/span>\r\n<\/a>\r\n","protected":false},"excerpt":{"rendered":"CSS\u304c\u300c\u601d\u3063\u305f\u901a\u308a\u306b\u4e0a\u66f8\u304d\u3055\u308c\u306a\u3044\u300d\u3068\u304d\u3001\u539f\u56e0\u306e\u591a\u304f\u306f\u8a73\u7d30\u5ea6\uff08specificity\uff09\u306e\u7406\u89e3\u4e0d\u8db3\u3067\u3059\u3002\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067 :is() \/ :where() \u3092\u4f7f\u3063\u305f\u8a73\u7d30\u5ea6\u8a2d\u8a08\u306e\u8a71\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u305d\u3082\u305d\u3082\u8a73\u7d30\u5ea6\u304c\u3069\u3046\u8a08\u7b97[...]","protected":false},"author":1,"featured_media":12964,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","footnotes":"","vk-ltc-link":"","vk-ltc-target":"0"},"categories":[11],"tags":[992,993,986,991,984,985,978,979,980,350,240],"class_list":["post-12955","post","type-post","status-publish","format-standard","has-post-thumbnail","category-html-css","tag-992","tag-css","tag-specificity","tag-where","tag-has","tag-is","tag-not","tag-350","tag-240"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/12955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/comments?post=12955"}],"version-history":[{"count":7,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/12955\/revisions"}],"predecessor-version":[{"id":12976,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/12955\/revisions\/12976"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media\/12964"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=12955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=12955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=12955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}