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

In-depth understanding of umask in new linux file permission settings

Preface The origin is a question 1: If your umask...

How to use boost.python to call c++ dynamic library in linux

Preface Recently I started using robot framework ...

Detailed graphic tutorial on installing centos7 virtual machine in Virtualbox

1. Download centos7 Download address: https://mir...

Analysis and solution of a.getAttribute(href,2) problem in IE6/7

Brief description <br />In IE6 and 7, in a ...

Linux uses iptables to limit multiple IPs from accessing your server

Preface In the Linux kernel, netfilter is a subsy...

MySQL MyISAM default storage engine implementation principle

By default, the MyISAM table will generate three ...

Bundling non-JavaScript static resources details

Table of contents 1. Custom import in packaging t...

Solution to the error in compiling LVGL emulator on Linux

Table of contents 1. Error phenomenon 2. Error An...

How to use Celery and Docker to handle periodic tasks in Django

As you build and scale your Django applications, ...

How to use axios request in Vue project

Table of contents 1. Installation 2. There is no ...

Sample code for generating QR code using js

Some time ago, the project needed to develop the ...

Summary of Linux commands commonly used in work

Use more open source tools such as docker and kub...