Html 您可以在 Firebug 中使悬停状态“粘滞”吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4105102/
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-29 05:07:52  来源:igfitidea点击:

Can you make hovered state in Firebug "sticky?"

htmlcssfirefoxfirebughover

提问by Kyle

When I'm debugging a site, sometimes the hovered selectors are a little long winded and similar to other ones, is there a way to apply a kind of "sticky" state to hover rules in Firebug?

当我调试站点时,有时悬停的选择器有点冗长且与其他选择器相似,有没有办法将一种“粘性”状态应用于 Firebug 中的悬停规则?

Example; I hover over a nav bar and want to copy the selector out of firebug to search in the CSS, but as soon as I move my mouse, the selector (obviously) disappears as the nav <li>isn't hovered anymore.

例子; 我将鼠标悬停在导航栏上并希望将选择器从萤火虫中复制出来以在 CSS 中进行搜索,但是一旦我移动鼠标,选择器(显然)就会消失,因为导航<li>不再悬停。

Any way to do this?

有没有办法做到这一点?

Thanks :)

谢谢 :)

回答by Subodh Ghulaxe

When inspecting links, Firebug shows the default CSS state, i.e. styles applied to a:link. By default, the :hover and :active styles are not shown. Fortunately, you can change the state of the link by clicking Style and choosing the appropriate option:

检查链接时,Firebug 会显示默认的 CSS 状态,即应用于 a:link 的样式。默认情况下,不显示 :hover 和 :active 样式。幸运的是,您可以通过单击样式并选择适当的选项来更改链接的状态:

enter image description here

在此处输入图片说明

回答by Kyle

For what I wanted, there's an option for it in the Styledropdown above the CSS styles for the element. Just click the dropdown, and select :activeor :hoverand it keeps the styles for the selected and hovered element :)

对于我想要的,Style在元素的 CSS 样式上方的下拉列表中有一个选项。只需单击下拉列表,然后选择:active:hover,它就会保留所选和悬停元素的样式:)

回答by Jorge Rivera

Sometimes items are not affected by the ":hover" state but by a mouseover in jQuery or similar, in that case you can manualy trigger the event (or force the event) in the console tab by writing:

有时项目不受 ":hover" 状态的影响,而是受 jQuery 或类似中的鼠标悬停的影响,在这种情况下,您可以通过编写在控制台选项卡中手动触发事件(或强制事件):

$('#a-random-selector').mouseover()

Hope it helps, I came here looking for this answer but had to figure it out myself

希望它有所帮助,我来这里是为了寻找这个答案,但必须自己弄清楚

回答by Mega3on

You can try using Chrome inspector, and trigger :active :visited state etc.. on the element under styles.

您可以尝试使用 Chrome 检查器,并在样式下的元素上触发 :active :visited 状态等。

enter image description here

在此处输入图片说明

回答by user3707094

Open both firebug and web developer->Inspector. In the Inspector window, locate the code line where the hover starts, right click the mouse and choose the :hover. Then the hover state will stay, you can do whatever you want in firebug.

打开 firebug 和 web developer->Inspector。在 Inspector 窗口中,找到悬停开始的代码行,右键单击鼠标并选择 :hover。然后悬停状态将保持,您可以在萤火虫中为所欲为。