child { background: green }
      #p4 { background: green; }
      #d4 > *:last-child { background: red }
    </style>
  </head>
  <body>
    <div id="d1"><p> </p><p id="p1"> </p></div>
    <div id="d2"><p> </p><p id="p2"> </p> </div>
    <div id="d3"><p> </p><p id="p3"> </p><!-- comment --></div>
    <div id="d4"><p> </p><p id="p4"> </p><span> </span></div>
  </body>
</html>
