.menu_blueSkin_Middle.dir_left div.align_left
ここでは 3 つのクラスが呼び出されます。
これらのクラスに名前を付けた人は誰でもアマチュアであるため、少し複雑です。CSS コードと同じ名前をクラスに付けてはいけません。
わかりやすくするために、表示されている 3 つのクラスの名前を変更しましょう。
- menu_blueSkin_Middle の名前を.firstclassに変更します
- dir_left の名前を.secondclassに変更します
- .align_leftを .thirdclass に名前を変更します
さて、3 つの名前が変更されたクラスを使用して、コードを示します。
.firstclass.secondclass div.thirdclass {
float: left;
}
わかりましたので、以下が適用されます。
- . thirdclass は影響を受ける唯一のものです [with float:left; コード]。
- div 内の . thirdclass クラスのみが影響を受けます。(その前に div があるため)
- .secondclass と .firstclass の両方の double 宣言を持つクラス内にある .thirdclass div のみが影響を受けます。
コード例:
<div class="firstclass secondclass">
<p class="thirdclass">
</p>
<!-- NOTE: THIS IS JUST A NOTE SO YOU KNOW WHICH IS AFFECTED.
The DIV below is the **only one affected**. The P above is NOT affected. Because it is not a DIV.
The DIV at the bottom is NOT affected. Because it is not nested inside the firstclass secondclass
-->
<div class="thirdclass">
</div>
</div>
<div class="thirdclass">
</div>