If you are purely trying to open the homepage from your login page, then you can use this code at the top of your code:

<form method="post" action="http://www.yourdomain.com/index.html">

or if you don't have a domain/hosting yet, then replace the http:// part to the path to the file where your index.html (or whatever you've called your other file)

This won't do any verification on the login form, but it will open the other page. For verification purposes it'd be better to use javascript/php. If you don't know javascript yet, I suggest you use this solution for now. Walk before you run and all that..

Answer from Rachel Gallen on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-login-form
HTML Login Form - GeeksforGeeks
July 23, 2025 - HTML login form is used to authenticate users and grant access to secure sections of a website or application. It typically includes input fields for username/email and password, along with a submit button for logging in.
🌐
Stack Overflow
stackoverflow.com › questions › 74496402 › basic-html-login-form
Basic HTML login form - Stack Overflow
<html> <head> <title>Javascript Login Form Validation</title> <!-- Include CSS File Here --> <link rel="stylesheet" href="css/style.css"/> <!-- Include JS File Here --> <script src="js/login.js"></script> </head> <body> <div class="container"> <div class="main"> <form id="form_id" method="post" name="myform"> <label>USER:</label> <input type="text" name="username" id="username"/> <label>PASS:</label> <input type="password" name="password" id="password"/> <input type="button" value="LOGIN" id="submit" onclick="validate()"/> </form> <br> <br> username is <b>asd</b> and password is <b>123</b> </div> </div> </body> </html> <!--THE JS JAVASCRIPT PART BELOW--> <head> <script> var attempt = 4; // Variable to count number of attempts.
People also ask

Can I add social login options to my HTML login page?
Yes, you can integrate social login options by using OAuth with services like Google Sign-In or Facebook Login, enhancing user convenience and security.
🌐
dhiwise.com
dhiwise.com › post › how-to-make-a-login-page-in-html-a-step-by-step-guide
How to Make a Login Page in HTML: A Simple Guide
How can I make my login page more secure?
Implement HTTPS, use strong password hashing algorithms, and ensure your authentication mechanism is robust to protect user data.
🌐
dhiwise.com
dhiwise.com › post › how-to-make-a-login-page-in-html-a-step-by-step-guide
How to Make a Login Page in HTML: A Simple Guide
How do I ensure my login form is responsive on all devices?
Use CSS media queries to customize the layout and style of your login form dependent on the device's screen size.
🌐
dhiwise.com
dhiwise.com › post › how-to-make-a-login-page-in-html-a-step-by-step-guide
How to Make a Login Page in HTML: A Simple Guide
🌐
W3Schools
w3schools.com › howto › howto_css_login_form.asp
How To Create a Login Form
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
🌐
Udacity
udacity.com › blog › 2025 › 06 › how-to-build-a-modern-login-page-with-html-and-css.html
How to Build a Modern Login Page with HTML and CSS | Udacity
June 2, 2025 - In this guide, you'll learn about the creation of a modern, responsive login page with HTML, CSS, and JavaScript via code examples, design considerations, and more.
🌐
Quora
quora.com › How-do-I-create-a-simple-login-page-on-HTML-and-CSS
How to create a simple login page on HTML and CSS - Quora
Answer (1 of 2): Here is a simple login page using HTML and CSS. Keep in mind it’s nonfunctional as it will need server-side code to actually log in. This can be done in PHP. [code] Login html, body{ margin:0...
🌐
Colorlib
colorlib.com › home › inspiration › 42 free html5 & css3 login form templates for your website 2026
42 Free HTML5 & CSS3 Login Form Templates For Your Website 2026
January 26, 2026 - Whether logging into websites, applications or forms, offering as many options as possible is always cool. Social login can be much quicker than the traditional username/password alternative. Download Preview WordPress version · Login Form V06 is a beautiful free HTML login form with a split-layout template with image and form sections.
Find elsewhere
🌐
YouTube
youtube.com › codehal
Login Form in HTML & CSS - YouTube
Login Form in HTML and CSS, Login Page HTML CSS, Login Form using HTML and CSS, Login Form HTML CSS, Login Page HTML CSS, Login Form CSSClick For More: https...
Published   June 18, 2023
Views   1M
🌐
DhiWise
dhiwise.com › post › how-to-make-a-login-page-in-html-a-step-by-step-guide
How to Make a Login Page in HTML: A Simple Guide
October 11, 2024 - Creating a login page is a fundamental ... on websites and applications. Whether building a small project or a large-scale web application, understanding how to craft a secure, responsive, and user-friendly login page is crucial. This blog will walk you through creating a simple login page using HTML, CSS, and ...
🌐
Medium
medium.com › swlh › how-to-create-your-first-login-page-with-html-css-and-javascript-602dd71144f1
How to create your first login page with HTML, CSS and JavaScript | by José Fernando Costa | The Startup | Medium
April 15, 2020 - Instead, when the user clicks the login button we validate that the username is “user” and the password is “web_dev” using JavaScript. If they match, then an alert dialog is shown and the page is reloaded (for the sake of simplicity); otherwise, we display an error message. Now that you’re more familiar with the end result, let’s move on to the code. We’ll start with the HTML, as it is the one responsible for the information displayed in the page.
🌐
CodingNepal
codingnepalweb.com › home › login form › 30+ free login & registration form templates in html & css
30+ Free Login & Registration Form Templates in HTML & CSS
November 15, 2025 - The form is created using HTML and CSS, ensuring a visually appealing design. If you require a login form that includes options like Facebook or Twitter login, this form template could be suitable for your needs. By clicking the provided buttons, you can access the source code and live demo of this form. ... This template offers a website that features both a login and registration form.
🌐
CodeHim
codehim.com › home › collections › 65+ login page in html with css code sample simple to difficult
65+ Login Page in HTML with CSS Code Sample Simple to Difficult — CodeHim
January 22, 2024 - Here is a collection of login page created with HTML, CSS, JavaScript/jQuery code. You can view demo and download best login form for you.
🌐
Scaler
scaler.com › home › topics › how to create login page in html?
How to Create Login Page in HTML? - Scaler Topics
October 9, 2023 - We'll design a login page using HTML and CSS. A login page in HTML collects information from the user and has a submit button to send the details for server-side operations.
🌐
OneCompiler
onecompiler.com › html › 3xhjxm3ug
login page - HTML - OneCompiler
Almost every web page over internet might be using HTML.
🌐
W3Schools
w3schools.com › howto › howto_css_signup_form.asp
How To Create a Sign Up Form
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
🌐
Quora
quora.com › How-can-I-make-a-login-for-my-website-with-HTML
How to make a login for my website with HTML - Quora
Answer (1 of 3): A2A There are two primary ways. One is to login the HTML session — this is not often used any more. Two is to login to the session instance on the back end; usually, but not always, this involves cookies.
🌐
Evil Martians
evilmartians.com › blog › 11 html best practices for login & sign-up forms—martian chronicles, evil martians’ team blog
11 HTML best practices for login & sign-up forms—Martian Chronicles, Evil Martians’ team blog
October 23, 2024 - So, read on, then check your forms and improve your UX by using HTML technologies the way they should be used. Editor’s note: This post has been updated and checked for accuracy as of October, 2024! In general, sign-in and login forms are very simple. For most websites, they feature just 2 inputs and a submit button.
🌐
Reddit
reddit.com › r/webdev › learn to build a website with login and signup forms using html, css & javascript [tutorial video]
r/webdev on Reddit: Learn to Build a Website with Login and Signup Forms using HTML, CSS & JavaScript [Tutorial Video]
June 19, 2023 -

Hey everyone!

I'm excited to share this YouTube tutorial video on how to create a website with login and signup forms using HTML, CSS, and JavaScript. You'll learn how to create the HTML structure, style it with CSS & make CSS animation, and add interactive functionality using JavaScript.

Check out the video here: https://youtu.be/-RgAfHUEplQ

I've also included screenshots from the video:

Sign up form Login form

Feel free to watch the video, follow along, and leave any comments or questions you may have. I'm here to help and provide support throughout your learning journey!

I'm passionate about sharing my knowledge and helping others grow their web development skills. I hope this tutorial video proves to be a valuable resource for you.

Thank you for your time, and I look forward to hearing your feedback. Happy coding!

🌐
GitHub
github.com › bedimcode › login-form
GitHub - bedimcode/login-form: Login Form in HTML & CSS · GitHub
Login Form in HTML & CSS. Contribute to bedimcode/login-form development by creating an account on GitHub.
Starred by 71 users
Forked by 19 users
Languages   SCSS 42.5% | CSS 36.4% | HTML 21.1%