CSS 如何查看网页上元素的 ":hover" 和 ":active" 属性?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8720254/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 02:32:02  来源:igfitidea点击:

How can I see ":hover" and ":active" properties of elements on a webpage?

cssfirefoxgoogle-chrome

提问by Leo Jiang

In both Google Chrome and Firefox, the hover and active state CSS properties can only be viewed when the element is hovered or clicked. However, as soon as my mouse leaves the element or I release my mouse, I cannot view the properties any more.

在 Google Chrome 和 Firefox 中,悬停和活动状态 CSS 属性只能在元素悬停或单击时查看。但是,一旦我的鼠标离开该元素或我松开鼠标,我就无法再查看这些属性。

Is there a Chrome extension or Firefox addon that can allow me to view the elements in hover or active states?

是否有 Chrome 扩展程序或 Firefox 插件可以让我查看处于悬停或活动状态的元素?

采纳答案by Boris Zbarsky

Both Firebug and the DOM Inspector extension for Firefox allow you to inspect :hover and :active state on arbitrary elements, as I recall.

我记得,Firebug 和 Firefox 的 DOM Inspector 扩展都允许您检查任意元素上的 :hover 和 :active 状态。

回答by henryaaron

Click on the element inside the element inspector. Move your mouse over the element, press the up arrow key and then the down arrow key. You'll see the hover properties.

单击元素检查器内的元素。将鼠标移到元素上,按向上箭头键,然后按向下箭头键。您将看到悬停属性。