gpt-4o-2024-11-20· OpenAI
WildChat-4.8M (AI2)
buatkan contoh kode html login page
- User
buatkan contoh kode html login page
- Assistant
buatkan contoh kode html login page
Tentu! Berikut adalah contoh sederhana HTML untuk halaman login:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
.login-container {
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 300px;
}
.login-container h2 {
margin-bottom: 20px;
text-align: center;
color: #333;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
font-size: 14px;
margin-bottom: 5px;
color: #555;
}
.form-group input {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 14px;
}
.form-group input:focus {
outline: none;
border-color: #007bff;
}
button {
width: 100%;
background-color: #007bff;
color: white;
font-size: 16px;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.text-center {
text-align: center;
margin-top: 15px;
}
.text-center a {
color: #007bff;
text-decoration: none;
}
.text-center a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form action="login_process.php" method="POST">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Enter your username" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter your password" required>
</div>
<button type="submit">Login</button>
</form>
<div class="text-center">
<p>Don't have an account? <a href="register.html">Register here</a></p>
</div>
</div>
</body>
</html>
HTML Struktur:
form untuk memasukkan username dan password, yang kemudian dikirimkan menggunakan POST ke halaman login_process.php.CSS Styling:
Aksi Form:
login_process.php (alamat tujuan bisa disesuaikan dengan kebutuhan).Link ke Register Page:
register.html.Anda bisa menyesuaikan kode ini sesuai dengan kebutuhan Anda.
Not yet included in a published release.