zoukankan      html  css  js  c++  java
  • 鼠标放上去 ,其他元素变化颜色 字体 背景颜色

    可以通过JS实现 $(this).find("span").css('color','red');方式更改,通过CSS更改也是可以的

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Document</title>
    	<style>
            div {
            	500px;height:500px;background:pink;position: relative;
            }        
            span {
            	100px;height:100px;display:block;position: absolute;top:100px;left:100px;
            	background:#ddd;
            	transition:1s;
            }      
            div a:hover span {
            	background-color: #777;
            }
            div a {
            	color:red;
            	transition:1s;
            }
            div a:hover {
            	color:#000;
            }
    	</style>
    </head>
    <body>
    	<div>
    		<a href="#">
    			<span></span>
    			BACK TO TOP
    		</a>	
    	</div>
    </body>
    </html>
    

      

  • 相关阅读:
    杭电2042
    杭电2041
    杭电2040
    杭电2046
    SPOJ
    SPOJ
    SPOJ
    HDU
    HDU
    HDU
  • 原文地址:https://www.cnblogs.com/agansj/p/7761439.html
Copyright © 2011-2022 走看看