私は構造を持っています:
<div id="div">
    <ul class="ul">
        <li class="li_one">
        </li>
        <li class="li_two">
        </li>
    </ul>
</div>
疑似セレクターを使用background:redして2番目の要素(クラス "li_two")に設定し、最も外側のdivから開始したいと思います。li私はこのようにしようとしています:
#div > ul:nth-child(1) { background:red; }   // works but wrong, sets background to ul
#div ul:last-child { background:red; }   // doesn't set to any element
#div ul:first-child { background:red; }  // again sets to ul but not to li
#div [class=li_two] { background:red; }  // only this one works fine
またはセレクターli_twoを#div使用してスタイルを設定することはできますか?どうやってするの?:nth-child:last-child:first-child