I've encountered an issue where my logo and the mobile dropdown menu won't stay on the same line when the screen size falls below a certain point. I attempted to resolve this by using media queries to resize the image, but unfortunately, the problem persists. After reading advice on another thread suggesting to set the nav-bar brand background with CSS instead of using an img tag, I tried that approach but the image failed to display.
Below is the HTML code:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../../../favicon.ico">
<title>Pristine Clean Outs | Home</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Carousel style-->
<link href="css/carousel.css" rel="stylesheet">
<!--Custom Styles-->
<link rel="stylesheet" href="css/style.css">
</head>
<body id="top">
<header>
<div class="container-fluid">
<nav class="navbar navbar-expand-md navbar-light fixed-top bg-white">
<a class="navbar-brand" href="index.html"><img class="img-fluid logo" src="img/pristinelogo.png" alt=""></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="gallery.html">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
</div>
</nav>
</div>
</header>
Here is my CSS code:
/* Custom Styles for Pristine Clean by David Jacoby */
nav li {
font-size: 22px;
}
.carousel-item {
text-shadow: 2px 2px #000000;
}
.port-image {
width: 100%;
}
.gallery_product {
margin-bottom: 30px;
}
.contact-ul li {
font-size: 24px;
list-style-type: none;
}
/* MEDIA QUERIES */
@media (max-width: 768px) {
.logo {
width: 70%;
height: auto;
}
}