我想看到:hover样式的锚,我在Chrome中徘徊。在Firebug中,有一个样式下拉菜单,允许我为一个元素选择不同的状态。

我似乎在Chrome中找不到任何类似的东西。我遗漏了什么吗?


当前回答

使用JS可以触发元素上的MouseEvent。下面是如何对悬停进行操作。

使用右键单击检查元素。 像这样复制JS路径 在Sources Chrome DevTools中按“Esc”键打开控制台。 然后粘贴复制的路径,并添加.dispatchEvent(new MouseEvent('mouseover', {'bubbles': true}));是这样的: 按enter键,然后可以与悬停状态后发生的任何DOM更改进行交互。

其他回答

It's also possible that the code can be hidden in the database and there is no actual file containing it. A client of mine has the "Travelify" theme by Colorlib and some of the options from the WP admin GUI write directly to the DB and the DB generates the css code on the fly - I can see the css in html source but nowhere in any actual files. This drove me crazy and took me awhile to figure out. There's a great DB search tool for WP called "Search and Replace" by Inpsyde GmbH that I have found to be invaluable. Be careful with it of course!

干杯!

我可以通过遵循Babiker建议的以下步骤来看到风格 右键单击元素,但不要将鼠标指针移离该元素,保持悬停状态。通过键盘选择检查元素,就像点击箭头,然后回车键。”

改变风格遵循以上步骤,然后- 通过按键盘上的ctrl + tab来更改浏览器选项卡。 然后单击要调试的选项卡。你的悬停屏幕仍然在那里。现在小心地将鼠标移到开发人员工具区域。

现在可以看到两个伪类规则,并将它们强加到元素上。

要查看样式窗格中的:hover之类的规则,单击右上方的小:hov文本。

要强制一个元素进入:hover状态,右键单击它并选择:hover。

在Chrome开发人员工具快捷方式的元素面板上的额外提示。

我知道我所做的是相当的变通,但它工作完美,这是我每次都做的方式。

然后,像这样进行:

首先确保Chrome开发工具是未停靠的。 然后,将Dev Tools窗口的任意一侧移动到你想要检查的元素中间。

最后,悬停元素,右键单击并检查元素,将鼠标移动到开发工具窗口,你将能够玩你的元素:悬停css。

干杯!

我用Chrome调试菜单悬停状态,这样做是为了能够看到悬停状态代码:

在元素面板上点击切换元素状态按钮并选择:悬停。

在“脚本”面板中,选择右下角的“事件侦听器断点”,然后选择鼠标->鼠标。

现在检查菜单并选择您想要的方框。当你释放鼠标按钮时,它应该会停止,并在元素面板中显示所选元素的悬停状态(请参阅样式部分)。