Merhaba. Bu örneğimizde html vs css kullanarak bir giriş formu tasarlayacağız.
Html kodlarımız:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Giriş Formu | Kodlamaklazim</title>
<link rel="stylesheet" href="styles.css"> <!-- CSS dosyamızı bağlayalım -->
</head>
<body>
<div class="login-container">
<h2>Giriş Yap</h2>
<form action="#">
<div class="input-group">
<label for="username">Kullanıcı Adı:</label>
<input type="text" id="username" name="username" required>
</div>
<div class="input-group">
<label for="password">Şifre:</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit">Giriş Yap</button>
</form>
</div>
</body>
</html>
CSS Kodlarımız:
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-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2 {
text-align: center;
}
.input-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 3px;
}
button {
width: 100%;
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 3px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}