Skip to content
Related Articles

Related Articles

Improve Article

How to make responsive sliding login and registration form using HTML CSS and JavaScript ?

  • Difficulty Level : Basic
  • Last Updated : 03 Aug, 2021
Geek Week

Forms are used in webpages for the user to enter their required details that further send to the server for processing. A form is also known as a web form or HTML form. In this article, you will learn to make a responsive sliding login and registration form using HTML, CSS, and Javascript. 

The main crux of this article is to slide form in to-for(left-right) motion when clicking the buttons and this can be done using animate() method in JQuery which is an inbuilt method in jQuery which is used to change the state of the element with CSS style.

Syntax:

(selector).animate({styles}, para1, para2, para3);

Using animate() method in JQuery is discussed further in this article.

Implementation step by step:



HTML Code: First we will add HTML code to form the basic structure of Login and Registration form.

 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <meta name="viewport" content=
        "width=device-width, initial-scale=1" />
    <script src=
    </script>
</head>
 
<body>
    <div id="background">
        <div class="background-Right"></div>
        <div class="background-Left"></div>
    </div>
 
    <div id="slide">
        <div class="top">
            <div class="left">
                <div class="content">
                    <h2>Sign Up</h2>
                    <form method="post"
                        onsubmit="return false;">
                        <div>
                            <input type="text"
                                placeholder="email" />
                             
                            <br />
                            <input type="password"
                                placeholder="password" />
                        </div>
                    </form>
 
                    <button id="LeftToRight"
                        class="on-off">Login
                    </button>
                     
                    <button>Register</button>
                </div>
            </div>
 
            <div class="right">
                <div class="content">
                    <h2>Login</h2>
                    <form method="post"
                        onsubmit="return false;">
                        <div>
                            <input type="text"
                                placeholder="email" />
                             
                            <br />
                            <input type="password"
                                placeholder="password" />
                        </div>
 
                        <button id="RightToLeft"
                            class="on-off">Register
                        </button>
                         
                        <button>Login</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
 
</html>

Output: 

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it’s lowest price ever!




My Personal Notes arrow_drop_up
Recommended Articles
Page :