<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>MyHtml.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> <style type="text/css"> .outer:hover .inner{ display: none; } </style> </head> <body> <div class="outer" > 鼠标滑过这里的时候 <div class="inner">这里为什么当鼠标滑过不隐藏呢?</div> </div> </body></html> 目前不是所有浏览器都支持标签的:hover伪类写法的,如(除标签外)~~~
最好用JS实现隐藏效果咯
目前不是所有浏览器都支持标签的:hover伪类写法的,如(除标签外)~~~
最好用JS实现隐藏效果咯
<script src="JS/jquery-1.7.1.min.js"></script> <script> $(function () { $(".outer").hover(function () { $(this).find(".inner").hide(); }, function () { $(this).find(".inner").show(); }); }); </script>你是在IE下测试的吧,按F12把文档模式设置成 非Quirks标准就可以了
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号