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