Here is the image: website responsiveness bug
One of my nav bar items is completely not lined up. I am thinking it is the search bar but I don't entirely know, or it might be the padding or margin, but I still don't know. It has been a day since I have been able to solve the problem. I just need help getting it lined up for the website.
Here is the CSS code:
* {
box-sizing: border-box;
}
body {
margin: 0;
width: 100%;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
}
.nav-bar {
overflow: hidden;
height: 80px;
}
.nav-bar a {
float: right;
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 16px;
}
.nav-bar a:hover {
cursor: pointer;
}
.nav-bar a.active {
background-color: #ccc;
}
.nav-bar .search-container {
float: right;
}
.nav-bar input[type="text"] {
margin-top: 6px;
margin-top: 12px;
margin-left: 1.5rem;
font-size: 16px;
height: 20px;
border: 1.5px solid black;
border-radius: 0.15rem;
}
.nav-bar .search-container button {
float: right;
padding: 6px;
margin-top: 7px;
margin-right: 5rem;
background: none;
font-size: 16px;
border: none;
cursor: pointer;
}
.nav-bar .search-container button .fa-search {
font-size: 15px;
margin-left: 0.5rem;
}
.nav-bar .logo-container {
float: left;
}
.nav-bar .logo-container img {
margin-left: 4rem;
object-fit: contain;
width: max-content;
height: 50px;
}
@media screen and (max-width: 1050px) {
.nav-bar ul a {
float: none;
}
.nav-bar {
height: max-content;
}
.nav-bar input[type=text] {
margin-left: 0rem;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="nav-bar" id="nav-bar">
<ul>
<div class="logo-container">
<img src="images/textlogo.png" alt="Paradigm Pet Professionals" />
</div>
<div class="search-container">
<form action="">
<input type="text" name="search" />
<button type="submit"><i class="fa fa-search"></i></i></button>
</form>
</div>
<a href="Small A/index.html">Small A</a>
<a href="Birds/index.html">Birds</a>
<a href="Fish/index.html">Fish</a>
<a href="Dogs/index.html">Dogs</a>
<a href="Cats/index.html">Cats</a>
<a class="active" href="#">Home</a>
</ul>
</div>
I need help lining up the nav bar items for a website that I am trying to work on the responsiveness for, any help is appreciated. I just need some help and this problem will be fixed.