2
Sample HTML code for a simple login page:
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-box">
<h2>Login</h2>
<form action="login.php" method="post">
<div class="user-box">
<input type="text" name="username" required="">
<label>Username</label>
</div>
<div class="user-box">
<input type="password" name="password" required="">
<label>Password</label>
</div>
<input type="submit" value="Submit">
</form>
</div>
</body>
</html>
The CSS styles for positioning and styling the form elements and submit button are defined in a separate CSS file. The form action is set to "login.php" which is the server-side script that will validate the user's input and authenticate them.
2
To create a login page using Visual Studio Code, you can follow these steps:
Step1: Open Visual Studio Code and create a new HTML file.
Step2: Inside the HTML file, create a form element and add the necessary input fields for username and password.
Step3: Add a submit button to the form and set its type to "submit".
Step4: Create a CSS file to style the login page.
Step5: In the CSS file, add styles to position and style the form elements and submit button as desired.
Step6: To add functionality to the login page, you can use JavaScript or a server-side language like PHP to validate the input and authenticate the user.