集中注意力时在多个班级上使用过渡

有没有一种方法可以仅使用css来停止某些元素具有焦点时元素的所有转换。

示例:我的输入的过渡依赖于.container:hover,当它获得焦点时,所有过渡都会停止,但仅针对输入,是否有办法在输入具有焦点时停止其他类的过渡?

<!DOCTYPE html> 
<html>
<head>
<style>
.container {
padding: 0px;
margin: 0px;
height:50px;
width:50px;
background-color:steelblue;
-webkit-transition: width 0.2s ease-in;
-webkit-transition-delay: 0s;
-webkit-transition-timing-function: linear;

}
.search-icon{
float: left;
position: relative;
top: 10px;
left:18px;
font-size: 26px;
color: white;
cursor: default;
}

.container:hover
{
width:250px;
}
.container:hover .input{
visibility: visible;
width: 185px;
}


.container .search-input{
position: relative;
top: 0px;
left: 0px;
display: block;
margin: 0px;
padding: 10px;
}

.input{
visibility: hidden;
float: left;
position: absolute;
top: 13px;
left: 55px;
width: 30px;
height: 24px;
padding: 0px;
margin: 0px;
border-color: white;
background-color: white;
-webkit-transition: width 0.3s linear;
-webkit-transition-delay: 0s;
}

input[type="text"]:focus {
-webkit-transition: none;
visibility: visible;
width: 185px;
}
</style>
</head>

<body>
<div class="container">
    <div class="search-icon">
    <b>?</b>
    </div>
    <div class="search-input">
        <input type="text" class="input">
    </div>
</div>

</body>

</html>
lost32 回答:集中注意力时在多个班级上使用过渡

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3159634.html

大家都在问