停止css转换以在悬停状态下移动其他元素

停止css转换以在悬停状态下移动其他元素,css,Css,如何使第二个图像在悬停第一个图像时不移动,反之亦然?现在,非悬停图像正在更改其位置 第一次悬停{ 高度:80px; -webkit转换:所有1都易于输入输出; -moz转换:所有1都易于输入输出; -o型转换:所有1均易于输入输出; 过渡:所有1都易于输入输出; } 第二次悬停{ 高度:80px; -webkit转换:所有1都易于输入输出; -moz转换:所有1都易于输入输出; -o型转换:所有1均易于输入输出; 过渡:所有1都易于输入输出; } 第一次悬停:悬停{ 高度:100px; -w

如何使第二个图像在悬停第一个图像时不移动,反之亦然?现在,非悬停图像正在更改其位置


第一次悬停{
高度:80px;
-webkit转换:所有1都易于输入输出;
-moz转换:所有1都易于输入输出;
-o型转换:所有1均易于输入输出;
过渡:所有1都易于输入输出;
}
第二次悬停{
高度:80px;
-webkit转换:所有1都易于输入输出;
-moz转换:所有1都易于输入输出;
-o型转换:所有1均易于输入输出;
过渡:所有1都易于输入输出;
}
第一次悬停:悬停{
高度:100px;
-webkit转换:所有1都易于输入输出;
-moz转换:所有1都易于输入输出;
-o型转换:所有1均易于输入输出;
过渡:所有1都易于输入输出;
}
第二次悬停:悬停{
高度:100px;
-webkit转换:所有1都易于输入输出;
-moz转换:所有1都易于输入输出;
-o型转换:所有1均易于输入输出;
过渡:所有1都易于输入输出;
}

您可以使用
位置:绝对
,检查jsfiidle:


您可以使用
position:absolute
,检查jsfidle:


你应该在
img.第一次悬停
img.第二次悬停
类中定位

img.first-hover {
    height:80px;
     -webkit-transition: all 1s ease-in-out; ;
     -moz-transition: all 1s ease-in-out; 
     -o-transition: all 1s ease-in-out;
     transition: all 1s ease-in-out;
     position: absolute;
}

img.second-hover {
    left:70px;
    height:80px;
     -webkit-transition: all 1s ease-in-out; ;
     -moz-transition: all 1s ease-in-out; 
     -o-transition: all 1s ease-in-out;
     transition: all 1s ease-in-out;
     position: absolute;
}

您应该在
img.first hover
img.second hover
类中定位

img.first-hover {
    height:80px;
     -webkit-transition: all 1s ease-in-out; ;
     -moz-transition: all 1s ease-in-out; 
     -o-transition: all 1s ease-in-out;
     transition: all 1s ease-in-out;
     position: absolute;
}

img.second-hover {
    left:70px;
    height:80px;
     -webkit-transition: all 1s ease-in-out; ;
     -moz-transition: all 1s ease-in-out; 
     -o-transition: all 1s ease-in-out;
     transition: all 1s ease-in-out;
     position: absolute;
}

你必须给它一个绝对位置,像这样:你必须给它一个绝对位置,像这样:谢谢你的快速反应!:)谢谢您的快速回复!:)