Is there a way to align login and register buttons side by side using HTML and CSS? I want the register button to redirect to register.php
I attempted to create a register button with the <input>
element, but I couldn't get them to display next to each other. Using display:inline;
did not work as well.
*{
font-family: 'Montserrat', sans-serif;
}
body,
html{
margin: 0px;
padding: 0px;
background-color: #0E0E0E;
}
.login-box{
background-color: #010100;
width: 400px;
height: 388px;
margin: 250px auto;
}
.login-box h1{
color: #FFFFFF;
margin:0px 35px;
margin-bottom: 35px;
padding-top: 25px;
}
.login-box form input{
display: block;
width: 324px;
height: 50px;
margin-left: 35px;
margin-right: 41px;
margin-bottom: 24px;
}
#submit{
display: inline;
color: #010100;
background-color: #E4FF77;
border: 2px solid transparent;
border-radius: 12px;
width: 150px;
height: 50px;
margin-left: 24px;
margin-right: 41px;
margin-bottom: 33px;
}
#pwdreset{
display: block;
color: #FFFFFF;
text-decoration: none;
margin: 20px 0px;
margin-left: 225px;
}
#register-button {
display: inline;
color: #010100;
background-color: #E4FF77;
border: 2px solid transparent;
border-radius: 12px;
width: 150px;
height: 50px;
margin-left: 24px;
margin-right: 41px;
margin-bottom: 33px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="signin.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<title>Agreya - Login</title>
</head>
<body>
<div class="login-box">
<h1>Login</h1>
<form class="login-form" action="login.php" method="post">
<input id="username" type="text" name="username" placeholder="Email" >
<input id="password" type="password" name="password" placeholder="Password">
<a id="pwdreset" href="#">Forgot password?</a>
<input id="submit" type="submit" name="submit" value="Login">
</form>
<form action="https://www.w3docs.com/">
<input id="register-button" type="submit" name="register" value="Register">
</form>
</div>
</body>
</html>