Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    How to create Airpods Animation using HTML CSS and JS

    15 July 2025

    How to create Heart Animation using HTML CSS and JS

    11 July 2025

    How to create Tab Bar Navigation using HTML CSS and JS

    9 July 2025
    Facebook X (Twitter) Instagram YouTube Telegram Threads
    Coding StellaCoding Stella
    • Home
    • Blog
    • HTML & CSS
      • Login Form
    • JavaScript
    • Hire us!
    Coding StellaCoding Stella
    Home - HTML & CSS - Next Level Login & Registration Form using HTML & CSS
    HTML & CSS

    Next Level Login & Registration Form using HTML & CSS

    Coding StellaBy Coding Stella11 January 2024Updated:11 January 20241 Comment5 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Email WhatsApp Copy Link

    Hey fellow coders! Today, we’re stepping up our game by creating a cool login form using HTML, CSS, and a touch of JavaScript. No need to stress about complex frameworks – we’re keeping it simple and fun!

    In this blog post, we’re not just making a basic login form; we’re adding a bit of JavaScript to make it interactive and user-friendly. Whether you’re a coding pro or just starting, this tutorial is here to boost your skills.

    Why should you care? Well, an interactive login form isn’t just about aesthetics; it’s about understanding how these three languages work together seamlessly. So, let’s dive into the basics of HTML and CSS for structure and style, and then sprinkle in some JavaScript to make our form stand out.

    Grab your coding tools, fire up your text editor, and let’s make a login form that’s not only functional but also a little bit awesome. Ready to take your coding to the next level? Let’s do this!

    HTML :

    The given HTML code represents a login and registration form. It consists of two sections: “Sign Up” and “Sign In”. The form includes input fields for username, email address, and password, along with corresponding icons. Users can switch between the sign-up and sign-in forms by clicking on the “Log in” or “Create an account” links.

    The JavaScript code at the end of the HTML file adds functionality to toggle between the two forms when the links are clicked.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Next Level Login & Registration  Form | Coding Stella</title>
    	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    	<link rel="stylesheet" href="style.css">
    </head>
    <body>
    	<div class="container">
    		<div class="form signup">
    			<h2>Sign Up</h2>
    			<div class="inputBox">
    				<input type="text" required="required">
    				<i class="fa-regular fa-user"></i>
    				<span>username</span>
    			</div>
    			<div class="inputBox">
    				<input type="text" required="required">
    				<i class="fa-regular fa-envelope"></i>
    				<span>email address</span>
    			</div>
    			<div class="inputBox">
    				<input type="password" required="required">
    				<i class="fa-solid fa-lock"></i>
    				<span>create password</span>
    			</div>
    			<div class="inputBox">
    				<input type="password" required="required">
    				<i class="fa-solid fa-lock"></i>
    				<span>confirm password</span>
    			</div>
    			<div class="inputBox">
    				<input type="submit" value="Create Account">
    			</div>
    			<p>Already a member ? <a href="#" class="login">Log in</a></p>
    		</div>
    		
    		<div class="form signin">
    			<h2>Sign In</h2>
    			<div class="inputBox">
    				<input type="text" required="required">
    				<i class="fa-regular fa-user"></i>
    				<span>username</span>
    			</div>
    			<div class="inputBox">
    				<input type="password" required="required">
    				<i class="fa-solid fa-lock"></i>
    				<span>password</span>
    			</div>
    			<div class="inputBox">
    				<input type="submit" value="Login">
    			</div>
    			<p>Not Registered ? <a href="#" class="create">Create an account</a></p>
    		</div>
    
    	</div>
    
    	<script>
    		let login = document.querySelector('.login');
    		let create = document.querySelector('.create');
    		let container = document.querySelector('.container');
    
    		login.onclick = function(){
    			container.classList.add('signinForm');
    		}
    		
    		create.onclick = function(){
    			container.classList.remove('signinForm');
    		}
    	</script>
    </body>
    </html>

    CSS :

    The given CSS code is for styling a login and registration form. It sets the font family to “Poppins” and applies a dark background color to the body. The form is contained within a container with rounded corners and a border. The input fields have a custom design with icons, and the labels transition and change color when the input is focused or has valid content. The submit button has a contrasting color and a box shadow effect.

    Overall, the CSS code creates a visually appealing and user-friendly form design.

    @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: "Poppins", sans-serif;
    }
    
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #223243;
    }
    
    .container {
      padding: 40px;
      border-radius: 20px;
      border: 8px solid #223243;
      box-shadow: -5px -5px 15px rgba(255, 255, 255, 0.1),
        5px 5px 15px rgba(0, 0, 0, 0.35),
        inset -5px -5px 15px rgba(255, 255, 255, 0.1),
        inset 5px 5px 15px rgba(0, 0, 0, 0.35);
    }
    
    .container .form {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      gap: 25px;
    }
    
    .container .form.signin,
    .container.signinForm .form.signup {
      display: none;
    }
    
    .container.signinForm .form.signin {
      display: flex;
    }
    
    .container .form h2 {
      color: #fff;
      font-weight: 500;
      letter-spacing: 0.1em;
    }
    
    .container .form .inputBox {
      position: relative;
      width: 300px;
    }
    
    .container .form .inputBox input {
      padding: 12px 10px 12px 48px;
      border: none;
      width: 100%;
      background: #223243;
      border: 1px solid rgba(0, 0, 0, 0.1);
      color: #fff;
      font-weight: 300;
      border-radius: 25px;
      font-size: 1em;
      box-shadow: -5px -5px 15px rgba(255, 255, 255, 0.1),
        5px 5px 15px rgba(0, 0, 0, 0.35);
      transition: 0.5s;
      outline: none;
    }
    
    .container .form .inputBox span {
      position: absolute;
      left: 0;
      padding: 12px 10px 12px 48px;
      pointer-events: none;
      font-size: 1em;
      font-weight: 300;
      transition: 0.5s;
      letter-spacing: 0.05em;
      color: rgba(255, 255, 255, 0.5);
    }
    
    .container .form .inputBox input:valid ~ span,
    .container .form .inputBox input:focus ~ span {
      color: #00dfc4;
      border: 1px solid #00dfc4;
      background: #223243;
      transform: translateX(25px) translateY(-7px);
      font-size: 0.6em;
      padding: 0 8px;
      border-radius: 10px;
      letter-spacing: 0.1em;
    }
    
    .container .form .inputBox input:valid,
    .container .form .inputBox input:focus {
      border: 1px solid #00dfc4;
    }
    
    .container .form .inputBox i {
      position: absolute;
      top: 15px;
      left: 16px;
      width: 25px;
      padding: 2px 0;
      padding-right: 8px;
      color: #00dfc4;
      border-right: 1px solid #00dfc4;
    }
    
    .container .form .inputBox input[type="submit"] {
      background: #00dfc4;
      color: #223243;
      padding: 10px 0;
      font-weight: 500;
      cursor: pointer;
      box-shadow: -5px -5px 15px rgba(255, 255, 255, 0.1),
        5px 5px 15px rgba(0, 0, 0, 0.35),
        inset -5px -5px 15px rgba(255, 255, 255, 0.1),
        inset 5px 5px 15px rgba(0, 0, 0, 0.35);
    }
    
    .container .form p {
      color: rgba(255, 255, 255, 0.5);
      font-size: 0.75em;
      font-weight: 300;
    }
    
    .container .form p a {
      font-weight: 500;
      color: #fff;
    }

    In our blog today, we made a cool login form using simple HTML, CSS, and a bit of JavaScript. It’s user-friendly and looks awesome! Learning these tricks makes coding fun. Keep coding happily, everyone!

    Should you encounter any bumps along the road with your project, fear not! The source code for this project is just a click away. Simply hit the Download button to kick off your coding expedition. Best of luck with your coding journey!

    login form
    Share. Copy Link Twitter Facebook LinkedIn Email WhatsApp
    Previous ArticleHow to make Responsive Footer using HTML & CSS
    Next Article YouTube New to You Button using HTML & CSS
    Coding Stella
    • Website

    Related Posts

    HTML & CSS

    How to create Netflix Intro Animation using HTML and CSS

    29 June 2025
    HTML & CSS

    How to create Social media popup hover menu using HTML and CSS

    25 June 2025
    HTML & CSS

    How to create Awesome Cool Loading Animation using HTML CSS and JS

    16 June 2025
    View 1 Comment

    1 Comment

    1. Pingback: 15 Free Login & Registration Form Projects in HTML CSS & JS | Frontend Project | Coding Stella

    Leave A Reply Cancel Reply

    Trending Post

    Master Frontend in 100 Days Ebook

    2 March 202420K Views

    How to make Modern Login Form using HTML & CSS | Glassmorphism

    11 January 202419K Views

    How to make I love you Animation in HTML CSS & JavaScript

    14 February 202417K Views

    How to make Valentine’s Day Card using HTML & CSS

    13 February 202413K Views
    Follow Us
    • Instagram
    • Facebook
    • YouTube
    • Twitter
    ads
    Featured Post

    How to make Hacker-style Login Form in HTML and CSS

    12 December 2023

    How to make Magic Mouse Effect using HTML CSS & JavaScript

    24 April 2024

    YouTube New to You Button using HTML & CSS

    11 January 2024

    How to make Heart Rate Animation Part 2 using HTML & CSS

    6 May 2024
    Latest Post

    How to create Airpods Animation using HTML CSS and JS

    15 July 2025

    How to create Heart Animation using HTML CSS and JS

    11 July 2025

    How to create Tab Bar Navigation using HTML CSS and JS

    9 July 2025

    How to create Newton’s Sun and Moon Loading Animation using HTML CSS and JS

    5 July 2025
    Facebook X (Twitter) Instagram YouTube
    • About Us
    • Privacy Policy
    • Return and Refund Policy
    • Terms and Conditions
    • Contact Us
    • Buy me a coffee
    © 2025 Coding Stella. Made with 💙 by @coding.stella

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Looks like you're using an ad blocker. We rely on advertising to help fund our site.
    Okay! I understood