最近便利なCSSおれおれAdvent Calendar 2023 – 13 日目 例えば td と th とか。似たような位置にある似たようなセレクターをまとめて書けるので楽ちんです。 例 デモ:https://codepen.io/ginpei/pen/yLZWJrz .TheTable > :is(thead, tbody) > tr > :is(th, td) { border: 1px solid lightgray; } :is() の詳細度に注意 :is() はその引数で与えられるセレクター群の中で最も詳細度が高いものになります。 例えば :is(a, .b, #c) と書いた場合、詳細度はそれぞれ a が 0,0,1 、 .b は 0,1,0 、 #c は 1,0,0 で、:is() 全体の詳細度は 1,0,0 になります。 これはちょっと注意が必要です。合致する対象ごとじゃ
![:is()と:where()で複数セレクターが便利(最近便利なCSSおれおれAdvent Calendar 2023 – 13日目) | Ginpen.com](https://cdn-ak-scissors.b.st-hatena.com/image/square/de4af7f62b39439905833504e59ba1e153be6d8b/height=288;version=1;width=512/https%3A%2F%2Fginpen.com%2Fwp-content%2Fthemes%2Fginpen-theme%2Fimg%2Ficon-512.png)