悬停时显示控件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了悬停时显示控件相关的知识,希望对你有一定的参考价值。

When you hover over the “message” div, the “controls” div inside it will appear, along with all of its content, giving you the same functionality as used by the Twitter web app.

There may be an issue with accessibility because screen readers may not be able to read the hidden on top of it.

This technique should of course be used with restraint because you don’t want to hide your important controls; but if used correctly, it can be useful for cleaning up your interface by removing those extra utility links that you don’t want to show up at all times.

Note that this doesn’t work in IE6, so you’ll need to override the hiding property in your IE6-specific style sheet or, if you don’t have one, simply use the IE6-specific source inside the head section of your code.
  1. .message .controls { display: none; }
  2. .message:hover .controls { display: block; }
  3.  
  4.  
  5. <!-- Place inside head -->
  6. <!--[if lt IE 7]>
  7. <style type="text/css" media="screen">
  8. .message .controls { display: block; }
  9. </style>
  10. <![endif]-->

以上是关于悬停时显示控件的主要内容,如果未能解决你的问题,请参考以下文章

悬停时显示控件

仅使用 CSS 悬停时显示文本

使用 PHP 在悬停时显示图像

禁用按钮时在悬停时显示工具提示

Django Admin - 悬停时显示图像

新手需要鼠标悬停的帮助和 HTML 页面上的地图以在鼠标悬停时显示图像