Is there a way to test CSS :hover in IE Developer tools?

爱⌒轻易说出口 提交于 2019-11-29 21:18:51
Leo Lei

I am not sure what version of IE you were using when you asked this question.

Just for everyone's information, I am able to view the hover style through the HTML tab by using the following sequence of steps in IE 9:

  1. Open the developer tool
  2. Hover over the element you want to view its hover CSS while leaving the developer window focused.
  3. Press F5 while your mouse is still over the element
  4. Ctrl + B and click on the element

You can now view the hover CSS.

Edit (Jan 2015):

In IE 11, you click the large blue "a:" icon that appears in the top right of the Styles pane of the DOM Explorer, and then check the "Hover" checkbox.

In IE11, you click the large blue "a:" icon that appears in the top right of the Styles pane of the DOM Explorer, and then check the "Hover" checkbox.

If you can't see the "a:", select an element or HTML tag in the left pane of the DOM Explorer first.

I couldn't find the CSS :hover state in IE developer tools either. So I just ended up using Firebug Lite from a bookmarklet.

Lao Lei's suggestion works. When you open the developer tools, be sure it is being on focus so it can receive the shortcut commands - when you click on the scrollbar of the page or on the page it focuses the browser window and makes all shortcut commands be send to the page. To avoid mistakes do the following:

  1. find the element you need
  2. Open the developer tools
  3. focus the developer tools' window
  4. hover the element you want
  5. Press F5 without moving the mouse
  6. Ctrl+B and click on the element

Best Regards.

For those who find this on Google, I created a cross browser tool that allows you to visualize your HTML / CSS layout just by moving the mouse. You can easily view elements in their hover state.

HTML Box Visualizer - GitHub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!