After reviewing your code, I noticed an issue with the indexing that was affecting the elements in the Nav bar. I made some adjustments to ensure proper alignment of the search bar on the right side by modifying the CSS for the Nav bar.
I updated the CSS properties to improve the layout and positioning of the Nav bar elements, making it more visually appealing and user-friendly.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="footer.php" />
<style>
/*----------------------START OF CSS PAGE BACKGROUND-----------------*/
body {
background-color: white;
font-size: 20px;
margin: 0;
}
/*----------------------END OF CSS PAGE BACKGROUND-----------------*/
/*----------------------START OF CSS STICKY NAVBAR AND DROPDOWN BUTTONS-----------------*/
.nav {
display: flex;
margin: 0;
padding: 0;
/* overflow: hidden; */
background-color: #38444d;
min-height: 45px;
position: -webkit-sticky;
/*Safari */
position: sticky;
top: 0;
/* Additional Changes */
justify-content: space-between;
align-items: center;
padding: 0 2%;
/* Additional Changes */
}
.nav ul {
display: flex;
list-style-type: none;
}
li {
float: center;
}
li a,
.dropbtn {
display: inline-block;
color: white;
text-align: left;
padding: 14px 16px;
text-decoration: none;
}
li a:hover,
.dropdown:hover .dropbtn {
background-color: red;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #dcdcdc;
}
.dropdown:hover .dropdown-content {
display: block;
}
/* Style the search box inside the navigation bar */
.topnav .search-container {
float: right;
}
.topnav input[type=text] {
padding: 8px;
margin-top: 10px;
font-size: 17px;
border: none;
}
.topnav .search-container button {
float: right;
padding: 6px 10px;
margin-top: 8px;
margin-right: 16px;
background: #ddd;
font-size: 17px;
border: none;
cursor: pointer;
}
.topnav .search-container button:hover {
background: #ccc;
}
@media screen and (max-width: 600px) {
.topnav .search-container {
float: none;
}
.topnav a,
.topnav input[type=text],
.topnav .search-container button {
float: none;
display: block;
text-align: left;
width: 100%;
margin: 0;
padding: 14px;
}
.topnav input[type=text] {
border: 2px solid #ccc;
}
}
/*----------------------END OF CSS STICKY NAVBAR AND DROPDOWN BUTTONS-----------------*/
/*----------------------------------------START OF CSS FOOTER----------------------------*/
/*footer basic*/
footer {
position: absolute;
left: 0;
right: 0;
background: #111;
height: auto;
margin: 0px;
padding-top: 0px;
color: #fff;
}
.footer-content {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
}
/*footer title*/
.footer-content h3 {
font-size: 2.1rem;
font-weight: 500;
text-transform: capitalize;
line-height: 3rem;
}
.footer-content p {
max-width: 500px;
margin: 10px auto;
line-height: 28px;
font-size: 14px;
color: #cacdd2;
}
/*footer social media icons */
.socials {
list-style: none;
display: flex;
align-items: center;
justify-content: center;
margin: 1rem 0 3rem 0;
background: transparent;
}
.socials li {
margin: 0 10px;
}
.socials a {
text-decoration: none;
color: #fff;
border: 1.1px solid white;
padding: 5px;
border-radius: 50%;
}
.socials a i {
font-size: 1.1rem;
width: 20px;
transition: color .4s ease;
}
.socials a:hover i {
color: aqua;
}
/*footer menu */
.footer-menu {
margin: 0px;
padding-bottom: 5px;
}
.footer-menu ul {
display: flex;
background: transparent;
align-items: center;
}
.footer-menu ul li {
padding-right: 10px;
display: block;
}
.footer-menu ul li a {
color: #cfd2d6;
border: 1.3px solid white;
padding: 6px 15px;
border-radius: 50px;
text-decoration: none;
}
.footer-menu ul li a:hover {
color: #27bcda;
}
/*footer credit section*/
/* Footer Styling Continues... */
</head>
<body>
<!-- HTML Content Goes Here -->
</body>
</html>