question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

:last-child and :last-of-type are not working when open with live server

See original GitHub issue

I’m submitting a…

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->

Current behavior

css pseudo-classes :last-child and :last-of-type are not working with div element when open with live server

index.html index.html

main.css main.css

On live server (no border on last div element) live server

Expected behavior

Open index.html directly (there is a border on last div element ) direct

Environment

Browser:

- [X] Chrome (desktop) version 67.0.3396.99
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
--




For Tooling issues:

- Live Server: 5.1.1
- Platform:  Windows 10 64 bits
- Visual Studio Code: 1.25.1

Others

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jomiltocommented, Sep 17, 2019

This lines are not working with live server.

p:last-child {
    color: brown;
}
0reactions
israelfxdcommented, Oct 21, 2022

I was looking for someone with the same problem, and that’s exactly it, when opened without Live Server it works correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

last-child and :last-of-type not working as intended [duplicate]
When I place the above CSS selector into Chrome's Developer Tools, it selects the last-child as intended but doesn't actually do anything -...
Read more >
Why Visual Studio Code Live Server Not Working? - YouTube
Live Server extension works fine with most of the machines but some of you might face an issue, it's not working perfectly on...
Read more >
Web scraping using Python: requests and lxml - GitHub Pages
It facilitates extracting the text, attribute values or HTML for a particular element. It knows how to handle badly-formed HTML (such as an...
Read more >
visited - CSS-Tricks
I'm a learning newbie and I've spent the best part of a morning trying to work out why my “visited” links would not...
Read more >
How to retrieve data using HTTP with Observables in Angular
Most applications obtain data from the backend server. They need to make an HTTP GET request. In this article, we'll look at making...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found