I've been working on creating a website for my friend, and I decided to include a table navigation bar to make it easier to navigate. Instead of duplicating the code, I separated the bar code into another file and used JavaScript to load it into each page. However, I've noticed that the bar appears much thicker than it did in the original file. Being new to JavaScript, I'm not sure how to troubleshoot this. Can someone provide some assistance?
Reference code: Navigation Bar:
<!-- NAVIGATION BAR CODE -->
<!DOCTYPE html>
<html>
<div class="header">
<header>
// Navigation code here
</header>
</div>
</html>
Code with nav bar:
// Code with JS loading the header
CSS:
// CSS styles for the navigation bar
Page using original bar:
// Page layout with the original navigation bar
Images: New and old navigation bars
I believe there may be an issue with how the JavaScript is injecting the code, but I'm unsure how to debug it due to my limited experience with JavaScript. I've attempted to adjust the CSS properties without success. Any guidance would be greatly appreciated.