0
私は頻繁にフォーラムでアバターの黒い背景を取り除くためにスタイリッシュなスタイルを書こうとしています(黒色の背景を置くので、透明でなく白く黒くなり、私は嫌いです)。 Chromeでセレクタをコピーすることによって一度に複数のサブ要素を選択する
私は上記XXは数字この
#mainpostcontent > table > tbody > tr > td > table.forumline > tbody > tr:nth-child(XX) > td:nth-child(1) > span > table > tbody > tr > td {
background: none !important;
}
に必要な引数を単離したツールを検査します。ユーザーはアバターを持っているかどうかの番号が変わるので、私は上のように
#mainpostcontent > table > tbody > tr > td > table.forumline > tbody > tr:nth-child(1) > td:nth-child(1) > span > table > tbody > tr > td {
background: none !important;
}
#mainpostcontent > table > tbody > tr > td > table.forumline > tbody > tr:nth-child(2) > td:nth-child(1) > span > table > tbody > tr > td {
background: none !important;
}
#mainpostcontent > table > tbody > tr > td > table.forumline > tbody > tr:nth-child(3) > td:nth-child(1) > span > table > tbody > tr > td {
background: none !important;
}
などのような、約200 individial線でスタイルを飽和する必要があります。
これらのすべてを1つのセレクタで選択する方法はありますか、最初のtr:nth-child(2)エントリをワイルドカードするのを防ぐCSSの制限はありますか?
編集:受け入れる答えボタンが見つかりませんでした。これは答えです: "tr:nth-child(3)のnth-child引数を削除して> tr> ? - Walker "
'> tr:nth-child(3)>'の 'nth-child'引数を削除して'> tr> 'にすることはできますか? –
もしそうでなければ、https://css-tricks.com/useful-nth-child-recipies/ –
'tr:nth-child(-n + 5)'を使って最初の5を選択することができます –