Untitled
unknown
plain_text
a year ago
2.0 kB
26
Indexable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<style>
body {
background-color: black;
}
.login-container {
max-width: 500px;
margin: 5rem auto;
padding: 2rem;
background-image: linear-gradient(red, pink, purple, violet);
border: 3px solid peru;
text-align: center;
height: 400px;
}
.login-container h2 {
margin-bottom: 1rem;
}
.login-container input {
margin-bottom: 1rem;
padding: 0.5rem;
border: 4px solid rgb(20, 2, 20);
width: 400px;
}
#username, #password {
margin-top: 40px;
}
#buttonnn {
width: 150px;
color: white;
background-color: black;
font-size: 20px;
font-weight: 200;
}
</style>
<script>
function validateForm() {
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
if (username === "" || password === "") {
alert("Username and password must not be empty!");
return false; // Prevent form submission
}
return true; // Allow form submission
}
</script>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form action="main.html" method="post" onsubmit="return validateForm()">
<input type="text" id="username" name="username" placeholder="username">
<input type="password" id="password" name="password" placeholder="password">
<button type="submit" id="buttonnn">Log In</button>
</form>
</div>
</body>
</html>
Editor is loading...
Leave a Comment