My website consists of two pages. The home page features a one-page navigation system where clicking on 'about' scrolls down to the corresponding section within the same page.
PART 1 - On index.html
- However, when clicking on the 'blog' navigation item, it should redirect to blog.html. In the
.header-nav
section, I have included the following code:
, but the link does not seem to work as expected. The browser shows that the link is directed to blog.html, but it doesn't navigate there.<li><a href="blog.html">Blog</a></li>
PART 2 - On Blog.html
- On blog.html, I have copied the
.header-nav
code from index.html. However, when I click on 'about', it should take me back to the home page and scroll down to the about section, which is not happening. The code works fine on the index.html page. Any insights or ideas on this issue would be greatly appreciated!
Index.html
<header class="main-header">
<div class="header-container">
<!-- logo wrapper -->
<div class="logo-wrapper">
<div id="logo-img-name">
<picture>
<source class="logo-img" media="(min-width: 320px)" srcset="img/mobile/mobile-logo.jpg">
<!-- <source media="(min-width: 465px)" srcset="img_white_flower.jpg">
--> <img class="logo-img" src="img_orange_flowers.jpg" alt="Flowers" style="width:auto;">
</picture>
<p class="logo-name"><a href="index.html">Keeva</a></p>
<!-- BURGER NAV -->
</div>
</div>
<a class="burger-nav"></a>
</div>
<ul class="header-nav">
<li><a id="home" href="#home-View">Home</a></li>
<li><a id="about" href="#about-View">About</a></li>
<li><a href="blog.html">Blog</a></li>
<li><a id="contact" href="#contact-View">Contact</a></li>
</ul>
</header>
Blog.html
<!-- Code for Blog.html goes here -->
JavaScript
// JavaScript functions go here
Full index.html
<!-- Full index.html code goes here -->