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

Specific use of MySQL global locks and table-level locks

Table of contents Preface Global Lock Table lock ...

Detailed explanation of 5 solutions for CSS intermediate adaptive layout

Preface When making a page, we often encounter co...

Apache Calcite code for dialect conversion

definition Calcite can unify Sql by parsing Sql i...

How to deploy a simple c/c++ program using docker

1. First, create a hello-world.cpp file The progr...

Analysis of the use and principle of Docker Swarm cluster management

Swarm Cluster Management Introduction Docker Swar...

Why MySQL does not recommend using null columns with default values

The answer you often hear is that using a NULL va...

Solving problems encountered when importing and exporting Mysql

background Since I converted all my tasks to Dock...

js to implement collision detection

This article example shares the specific code of ...

TypeScript namespace explanation

Table of contents 1. Definition and Use 1.1 Defin...

How to click on the a tag to pop up the input file upload dialog box

html Copy code The code is as follows: <SPAN cl...

How to build a SOLO personal blog from scratch using Docker

Table of contents 1. Environmental Preparation 2....

Example of how to increase swap in CentOS7 system

Preface Swap is a special file (or partition) loc...

What is em? Introduction and conversion method of em and px

What is em? em refers to the font height, and the ...