【发布时间】:2021-04-04 06:15:56
【问题描述】:
我的问题很简单,我没有找到直接的答案,所以在这里:我有两个框,我想悬停第一个但影响第二个(悬停第一个时,第二个应该这样做(转换:比例(1.2); 过渡:所有 0.9 秒缓进出;))。 是否可以使用 css 或也需要 javascript? 我的代码:
<!DOCTYPE html>
<html>
<head>
<style>
div {
display: inline-block;
margin: 30px;
font-weight: bold;
}
.a {
width: 100px;
height: 100px;
border : 1px solid black;
line-height: 100px;
text-align: center;
}
.c{
width: 100px;
height: 100px;
border : 1px solid black;
line-height: 100px;
text-align: center;
}
.d:hover {
transform: scale(1.2);
transition: all 0.9s ease-in-out;
}
</style>
</head>
<body>
<div class="a b">Hover me</div>
<div class="c d">Affect me</div>
</body>
</html>
【问题讨论】:
标签: javascript html css hover css-transitions