I am facing an issue with the live server in VS Code.
When I include a logo on the nav bar in my HTML code, it displays properly when I open the file without the live server. However, when I try to open it using the live server, the logo doesn't show up.
- Here is my HTML code:
<!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" />
<title>World Web</title>
<link rel="stylesheet" href="css/style.css" />
<!--Bootstrap Linked-->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
crossorigin="anonymous"
/>
</head>
<body>
<!--Nav Bar section Start-->
<div>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark container">
<a class="navbar-brand" href="">
<img src="../World Web/img/Brand/dark logo.svg" alt="logo" width="120" height="60">
</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Download</a>
</li>
</ul>
</div>
</nav>
</div>
<!--Nav Bar section End-->
<!--Hero section Start-->
<!--Hero section End-->
<!--AboutUs section Start-->
<!--About us section End-->
<!--Footer section Start-->
<!--Footer section End-->
<!--JavaScript-->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7L+jjXkk+Q2h455rYXK/7HAuoJl+0I4"
crossorigin="anonymous"
></script>
</body>
</html>
Here is the output when I open it in Chrome without the live server: output when I open it in Chrome without the live server
Here is the output when I open it using the live server:output using the live server
In the Nav bar, my logo does not appear when I open the file using the live server. However, it works fine when I open the file without the live server.