Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大画面では、7 番目の要素ごとに特定の境界線が必要です。中程度の画面では、これらのスタイルを 4 番目ごとに適用する必要があります。
スタイルを .small、.medium、.large の子孫にする方法を教えてください。
jqueryを初めて使う
$( "element:nth-child(7)" ).addClass("seventh_child"); $( "element:nth-child(4)" ).addClass("fourth_child");
上記を使用すると、デバイスの幅に応じて css プロパティを追加および削除できるメディア クエリを使用して、7 番目と 4 番目の要素をすべて見つけることができます。
私はそれがあなたを助けると思う...