live-server icon indicating copy to clipboard operation
live-server copied to clipboard

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

Open timonson opened this issue 4 years ago • 2 comments

Issue description

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

Software details

  • Command line used for launching live-server: live-server
  • OS: Linux, Arch
  • Node.js version: v14.4.0
  • live-server version: 1.2.1

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 avatar Jun 13 '20 21:06 timonson

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

timonson avatar Jun 13 '20 21:06 timonson

same problem here

yankunsong avatar Sep 30 '21 17:09 yankunsong