zoukankan      html  css  js  c++  java
  • 鼠标放上去会变化

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Document</title>
    	<style>
            a {
            	50px;height:50px;display:block;text-decoration: none;margin:100px auto;
            }
            .sp1 {
            	display:block;
            }
            .sp1  img {
            	100%;
            	display:block;  /*  img标签有个3px的bug,如果不加这个句话,会有bug ,测试一下就知道了 */
            }
            .sp2 {
            	display:none;50px;height:50px;background-color: #f39800;color:#fff;text-align:center;line-height: 50px;
            }
    	</style>
    </head>
    <body>
    	<a href="http://www.baidu.com"  target="_blank">
    		<span class="sp1">
    		    <img src="lapin.png" alt="">			
    		</span>
    		<span class="sp2">
    			 辣品
    		</span>
    	</a>
    </body>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script>
       $(document).ready(function(){
             $('a').hover(function(){
                 $(this).find(".sp2").css("display","block");
                 $(this).find('.sp1').css('display','none');
             },function(){
             	$(this).find('.sp1').css('display','block');
             	$(this).find('.sp2').css('display','none');
             })
       })
    </script>
    </html>
    

      

  • 相关阅读:
    vim tab 和4个空格
    python 入门
    pyenv 以及 virtualenv
    Redis Cluster 理论知识
    使用Redis SETNX 命令实现分布式锁
    go runtime scheduler
    LeetCode Valid Parentheses
    LeetCode Rotate Image
    leetcode
    HDU 3657 Game(取数 最小割)经典
  • 原文地址:https://www.cnblogs.com/agansj/p/7873653.html
Copyright © 2011-2022 走看看