Login Form with navbar
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET" type="text/css" href="web.css">
<title>web design</title>
</head>
<body>
<div class="topnav">
<a href="#" class="active">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
<div class="login">
<form>
<input type="text"placeholder="Username"name="Username">
<input type="text"placeholder="Passwords"name="psw">
<button type="submit">Login</button>
</form>
</div>
</div>
<div style="padding-left:16px ;">
<h2>Responsive Login Form in Navbar</h2>
<p>Navigation menu with a Login Form and a submit button inside of it</p>
<p>Reside a brower window to see the reponsive effect</p>
</div>
</body>
</html>
CSS Login Form with navbar Style
*{
box-sizing: border-box;
}
body{
margin:0;
font-family: Arial, Helvetica, sans-serif;
}
.topnav{
overflow: hidden;
background-color: #eee;
}
.topnav a{
float: left;
display: block;
color: #000;
text-align: center;
padding:14px 16px;
text-decoration: none;
font-size:17px;
}
.topnav a:hover{
background-color: #ddd;
color: #000;
}
.active{
background-color: #2196f3;
color: #fff;
}
.login{
float: right;
}
input[type=text]{
float: right;
padding:6px;
margin-top:8px;
font-size:17px;
border: none;
width:120px;
}
button{
float: right;
padding:6px 10px ;
margin-right:8px;
background-color: #555;
color: white;
font-size: 17px;
border: none;
cursor: pointer;
}
button:hover{
background-color: green;
color: #000;
}