简体   繁体   English

视图中元素的 CSS 选择器

[英]CSS selector for element that's in view

Is there a CSS selector for things that are in view , ie visible within the viewport?是否有 CSS 选择器用于视图中的事物,即在视口中可见?

You have to use Javascript to achieve that.您必须使用 Javascript 来实现这一点。 The modern way is to use getBoundingClientRect() .现代方法是使用getBoundingClientRect()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM