Hey guys here is a responsive registration form Using HTML + CSS and it is responsive with all the devices. Hope you like this
Here is The Code
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
}
.container {
background-color: #fff;
max-width: 500px;
margin: 50px auto;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px #aaa;
}
.container h2 {
text-align: center;
margin-top: 0;
}
form {
display: flex;
flex-direction: column;
}
label {
font-weight: bold;
margin-top: 10px;
}
input[type=text], input[type=email], input[type=password] {
padding: 10px;
margin: 5px 0;
border: none;
border-radius: 3px;
box-shadow: 0px 0px 5px #aaa;
}
button[type=submit] {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 3px;
cursor: pointer;
margin-top: 10px;
}
button[type=submit]:hover {
background-color: #3e8e41;
}
@media screen and (min-width: 600px) {
.container {
max-width: 800px;
}
form {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
label, input[type=text], input[type=email], input[type=password], button[type=submit] {
flex-basis: 48%;
}
}
</style>
</head>
<body>
<div class="container">
<h2>Registration Form</h2>
<form>
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Enter username">
<label for="email">Email</label>
<input type="email" id="email" name="email" placeholder="Enter email">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter password">
<label for="confirm_password">Confirm Password</label>
<input type="password" id="confirm_password" name="confirm_password" placeholder="Confirm password">
<button type="submit">Register</button>
</form>
</div>
</body>
</html>
0 Comments