tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.41k stars 484 forks source link

BUG: `:last-child` CSS selector not working #347

Open timonson opened 4 years ago

timonson commented 4 years ago

Issue description

When serving an index.html file with live-server the CSS selector :last-child doesn't select an element.

Software details

Example

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>'index.html'</title>
    <link rel="icon" href="data:," />
    <style>
      body div:last-child {
        background: blue;
      }
    </style>
  </head>
  <body>
    <div id="inlineWrapper">
      <a href="#" target="_blank">Anchor Text</a>
    </div>
    <div id="blockWrapper">
      <a href="#" target="_blank">Anchor Text</a>
    </div>
  </body>
</html>
timonson commented 4 years ago

For more information, look here please: https://github.com/ritwickdey/vscode-live-server/issues/174

yankunsong commented 2 years ago

same problem here