以下のように記述すると子要素が指定した数の場合にのみスタイルを適用できます。
ul:has(> :nth-child(N):last-child) li { }
子要素が2つの場合にのみスタイルを適用するには以下のように記述します。
ul:has(> :nth-child(2):last-child) li { }
Go to list of users who liked
More than 1 year has passed since last update.
以下のように記述すると子要素が指定した数の場合にのみスタイルを適用できます。
ul:has(> :nth-child(N):last-child) li { }
子要素が2つの場合にのみスタイルを適用するには以下のように記述します。
ul:has(> :nth-child(2):last-child) li { }
Register as a new user and use Qiita more conveniently
Go to list of users who liked