4.7K
Navigation menu bar with login form
Hello, friends in this tutorial I am going to make the navigation menu bar with a login form using HTML and CSS. You can see the left-side menus and the right-side login form of the navbar. If you make like this navigation menu bar users can easily log in to your site.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Navigation Bar with Login Form</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="topnav">
<a class="active" href="#home">Home</a>
<a href="#about">News</a>
<a href="#about">Blog</a>
<a href="#about">Gallery</a>
<a href="#about">About</a>
<a href="#contact">Contact</a>
<div class="login-container">
<form action="/action_page.php">
<input type="text" placeholder="Username" name="username">
<input type="text" placeholder="Password" name="psw">
<button type="submit">Login</button>
</form>
</div>
</div>
</body>
</html>
CSS
* {box-sizing: border-box;}
body{
margin: 0;
padding: 0;
font-family: Arial;
text-transform: uppercase;
font-weight: bold;
}
.topnav {
overflow: hidden;
background-color: #2f3a4a;
line-height: 40px;
}
.topnav a {
float: left;
display: block;
width:120px;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 16px;
color:#fff;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #2196F3;
color: white;
}
.topnav .login-container {
float: right;
margin-right: 100px;
margin-top: 10px;
}
.topnav input[type=text] {
padding: 6px;
margin-top: 8px;
font-size: 17px;
border: none;
width: 150px;
}
.topnav .login-container button {
float: right;
padding: 6px;
margin-top: 8px;
margin-right: 16px;
background: #2196F3;
color:#fff;
font-size: 17px;
border: none;
cursor: pointer;
}
.topnav .login-container button:hover {
background: #ccc;
}
For More Tutorials Please Click Here