首页htmlui_olHTML Element Style - 如何突出显示列表项而不突出显示其子项

HTML Element Style - 如何突出显示列表项而不突出显示其子项

我们想知道如何突出显示列表项而不突出显示其子项。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.focusNode {
  background-color: orange;
}

.focusNode ul {
  background-color: white;
}
</style>
</head>
<body>
  <ul>
    <li>root1</li>
    <li class="focusNode">root2
      <ul>
        <li>sub1</li>
        <li>sub2</li>
        <li>sub3</li>
      </ul>
    </li>
    <li>root3</li>
  </ul>
</body>
</html>