【发布时间】:2013-01-10 11:02:46
【问题描述】:
我正在尝试将一个div 的属性从另一个div 的悬停中更改。两个 div 都有自己的唯一 ID,我想知道这是否可能。
这里是 jsfiddle 链接: http://jsfiddle.net/Ngx5D/
这里是示例代码:
body {
background-color:lightgrey;
}
#div_one, #div_two{
background-color:darkred;
display:block;
width:300px;
text-align:center;
padding:30px;
margin:10px;
color:white;
-webkit-transition: 0.3s ease;
-moz-transition: 0.3s ease;
-ms-transition: 0.3s ease;
-o-transition: 0.3s ease;
transition: 0.3s ease;
}
#div_one:hover {
background-color:red;
}
【问题讨论】: