Is there a CSS selector for things that are in view, i.e. visible within the viewport?
Asked
Active
Viewed 755 times
4
-
Does this answer your question? [A CSS selector to get last visible div](https://stackoverflow.com/questions/5275098/a-css-selector-to-get-last-visible-div) – Carlos Eduardo Salazar Mori Aug 16 '20 at 01:22
-
1No there is not. – Paulie_D Aug 16 '20 at 06:14
1 Answers
1
You have to use Javascript to achieve that. The modern way is to use getBoundingClientRect()
.

k123
- 418
- 2
- 5
-
1I think the modern way is `IntersectionObserver`, I was just wondering if there's a pre-CSS way... – P Varga Aug 16 '20 at 08:38