CSS3+Bezier curve to achieve scalable input search box effect

CSS3+Bezier curve to achieve scalable input search box effect

Without further ado, here are the renderings.

The core code is transition: cubic-bezier(0.68, -0.55, 0.27, 1.55) all 1s; a buffer effect is added to the transition effect through the cubic-bezier (Bessel curve) of the transition attribute. The main module of the HTML code is an input plus a parent div. The div width needs to be larger than the input width. Without cubic-bezier, this effect can be achieved. transition: all 1s;

The transition effect lacks a buffer effect. The motion curve we use here is

Finally, the complete code

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <style type="text/css">
            .search-wrap{
                margin: 0 auto;
                width: 200px;
                height: 200px;
            }
            .search{
                width: 50px;
                height: 30px;
                margin: 20px 10px 0 0;
                border: 1px solid #4000FF !important;
                padding: 0 10px;
                float: right;
                border-radius: 5px;
                color: #fff;
                transition: all 1s;
                opacity: .5;
            }
            .search:focus{
                width: 100%;
                outline:none;
            }
        </style>
    </head>
    <body>
        <div class="search-wrap">
            <input type="text" name="" class="search">
        </div>
    </body>
</html>

This is the end of this article about how to use CSS3+Bezier curve to achieve a retractable input search box effect. For more relevant CSS3 Bezier curve retractable input search box content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

<<:  Analyze the method of prometheus+grafana monitoring nginx

>>:  How to make a div height adaptive to the browser height

Recommend

React hooks pros and cons

Table of contents Preface advantage: shortcoming:...

SQL insert into statement writing method explanation

Method 1: INSERT INTO t1(field1,field2) VALUE(v00...

Detailed explanation of Vue's live broadcast function

Recently, the company happened to be doing live b...

Optimization of MySQL thread_stack connection thread

MySQL can be connected not only through the netwo...

Summary of 4 solutions for returning values ​​on WeChat Mini Program pages

Table of contents Usage scenarios Solution 1. Use...

Summary of common Nginx techniques and examples

1. Priority of multiple servers For example, if e...

How to implement email alert in zabbix

Implemented according to the online tutorial. zab...

Detailed explanation of the usage of two types of temporary tables in MySQL

External temporary tables A temporary table creat...

Solution to running out of MySQL's auto-increment ID (primary key)

There are many types of auto-increment IDs used i...

JS Asynchronous Stack Tracing: Why await is better than Promise

Overview The fundamental difference between async...

Record the whole process of MySQL master-slave configuration based on Linux

mysql master-slave configuration 1. Preparation H...

How to implement Linux automatic shutdown when the battery is low

Preface The electricity in my residence has been ...

Solution to mysql server 5.5 connection failure

The solution to the problem that mysql cannot be ...

MySQL 8.0.11 installation and configuration method graphic tutorial (win10)

This article records the installation and configu...