<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Selector on たかおの解説</title><link>https://takao.blog/ja/tags/selector/</link><description>Recent content in Selector on たかおの解説</description><generator>Hugo -- gohugo.io</generator><language>ja</language><copyright>たかおの解説</copyright><lastBuildDate>Sat, 13 Jun 2026 23:11:50 +0900</lastBuildDate><atom:link href="https://takao.blog/ja/tags/selector/index.xml" rel="self" type="application/rss+xml"/><item><title>CSS親セレクタ :has() の超便利マークアップレシピ集</title><link>https://takao.blog/ja/web/css-has-pseudo-selector-recipes/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/ja/web/css-has-pseudo-selector-recipes/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS親セレクタ :has() の超便利マークアップレシピ集" /&gt;&lt;h2 id="css親セレクタ-has-の超便利マークアップレシピ集"&gt;CSS親セレクタ &lt;code&gt;:has()&lt;/code&gt; の超便利マークアップレシピ集
&lt;/h2&gt;&lt;p&gt;長年、CSS開発者は&lt;strong&gt;親セレクタ&lt;/strong&gt; — 子要素に基づいて親要素をスタイリングする方法 — を夢見てきました。JavaScriptや余分なクラス名が唯一の回避策でした。そこに登場したのが&lt;code&gt;:has()&lt;/code&gt;疑似クラスです。「この要素がXを含んでいたら、そのようにスタイルを変える」という処理をネイティブCSSで実現します。&lt;/p&gt;</description></item></channel></rss>