How to use chrome web inspector to view hover code

CssGoogle ChromeHoverGoogle Chrome-DevtoolsWeb Inspector

Css Problem Overview


Using chromes web inspector to view code is very useful. But how do you view for example the hover code for a button? You will have to hover the mouse over the button and thus cannot use it (mouse) in the inspector. Are there any shortcuts or other ways to accomplish this in the inspector?

Css Solutions


Solution 1 - Css

Now you can see both the pseudo-class style rules and force them on elements.

To see the rules like :hover in the Styles pane click the small dotted box button in the top right.

To force an element into :hover state, right click it.

Alternatively, you can use Event Listener Breakpoints sidebar pane in the Scripts panel and select to pause in mouseover handlers.

Solution 2 - Css

Alternatively, you can use Event Listener Breakpoints sidebar pane in the Scripts panel and select to pause in mouseover handlers.

Solution 3 - Css

It's a little annoying, but you need to right click on the element, and then, keeping your mouse over the link, use your keyboard select the 'Inspect Element' link and press enter. This should show you the css for the hover pseudo class for the selected element.

Here's hoping they make this a little easier in future builds.

Solution 4 - Css

In Chrome:

You can also mouseover on an element, and then click CTRL+SHIFT+C to inspect that element.

In Firefox:

enter image description here

in firebug:

enter image description here

source: https://stackoverflow.com/a/11272205/2165415

Solution 5 - Css

I'm not sure that I right understand your question but if you want to see the event handler code you can just inspect the element and look at Event Listeners sidebar pane of Elements Panel. Another way is just press pause button in Scripts Panel and just hover the element. The debugger will stop at the first instruction of the first event handler.

Solution 6 - Css

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBo.View Question on Stackoverflow
Solution 1 - CssTravis NorthcuttView Answer on Stackoverflow
Solution 2 - CssYury SemikhatskyView Answer on Stackoverflow
Solution 3 - CsspurpletonicView Answer on Stackoverflow
Solution 4 - CssT.ToduaView Answer on Stackoverflow
Solution 5 - CssloisloView Answer on Stackoverflow
Solution 6 - CssSantosh KhalseView Answer on Stackoverflow