了解如何使用 CSS 创建动画搜索表单。
单击输入字段:
<input type="text" name="search" placeholder="Search..">
input[type=text] {
width: 130px;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
}
/* When the input field gets focus, change its width to 100% */
input[type=text]:focus {
width: 100%;
}
亲自试一试 »
提示:去我们的HTML 表单教程了解有关 HTML 表单的更多信息。
去我们的CSS 表单教程了解有关如何设置 HTML 表单样式的更多信息。
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!