次のようなマークアップがあるとします。
<div class="abc"> ... </div>
<div class="xyz"> ... </div>
<div class="abc xyz" style="width: 100px"> ... </div>
とクラス<div>
の両方(最後のもの)を持つのみを選択し、そのインライン幅をオーバーライドして有効幅を 200 ピクセルにする方法はありますか?abc
xyz
このようなもの:
[selector] {
width: 200px !important;
}
ベストアンサー1
div.abc.xyz {
/* declarations go here */
}
...または単に:
.abc.xyz {
/* declarations go here */
}