gpt4 book ai didi

css - 点击输入外,返回false?

转载 作者:行者123 更新时间:2023-11-28 01:14:05 25 4
gpt4 key购买 nike

我用 CSS 创建了简单的动画。源代码在这里: https://drive.google.com/open?id=1MWOHpjTeqr_CBQaCvE4ccoY8nD8kjGFo但是我有一个问题,当您单击“搜索”并且所有动画都将结束,然后单击输入之外的某个地方时,输入再次变为圆圈。在输入之外单击时如何取消返回到 Circle?

body{
margin: 0;
padding: 0;
background-color: #999999;
}
input{
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
position: absolute;
border: none;
border-radius: 50%;
width: 200px;
height: 200px;
background-color: #404040;
text-align: center;
color: #fff;
font-size: 50px;
font-family: 'Catamaran';
outline: none;

}
input:hover{
background-color: #ff8533;
transition: 0.8s;
cursor: pointer;
}
input:focus{
animation: test 1s;
animation-fill-mode: forwards;
text-align: left;
}

::placeholder{
color: #fff;
font-weight: 600;
letter-spacing: 1px;
}
@keyframes test{
100%{width: 450px; border-radius: 30px; height: 100px; background-color: #595959; border: 1px solid #404040; cursor: auto; padding: 0px 20px;}
}
@keyframes test2{
100%{
border-radius: 50%;
width: 200px;
height: 200px;
background-color: #404040;
cursor: pointer;
padding: 0px;
}
}
<html>
<head>
<title>Web Developing</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Catamaran" rel="stylesheet">
</head>
<body>
<input type="text" placeholder="Search">
</body>
</html>

最佳答案

在点击处理程序中,您可以更改输入类,然后将该类添加到悬停/焦点样式:

input:focus, input.classaddedonclick {

关于css - 点击输入外,返回false?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51954794/

25 4 0
文章推荐: html 行高与小写重叠
文章推荐: css - IE11 消息栏从底部飞起而不是从顶部缓入
文章推荐: html - Play 字符串的 scala 模板语法
文章推荐: javascript - 如何在 android webview 中使用 js 获取特定的
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com