css(>) の直接の子セレクターは、直接の子孫を選択して色を渡しますが、テキスト装飾に関しては、他の要素も選択します。どうして?
http://codepen.io/anon/pen/dDJmE
色については、直系の子孫のみが選択されていることがわかりますが、テキスト装飾の動作が正しくないのはなぜですか? 私は何が欠けていますか?
CSS
li {
text-decoration: none;
color: black;
}
ol.numbers > li {
text-decoration: underline;
color: red;
}
HTML
<ol class="numbers">
<li> First! </li>
<li> Second!
<ul>
<li> hehe </li>
<li> huhu
<ol>
<li> nested! </li>
</ol>
</li>
</ul>
</li>
<li> Third! </li>
<li> Fourth!
<ol>
<li> oh lala </li>
</ol>
</li>
</ol>