Skip to content

Commit

Permalink
Merge pull request #2567 from ritiksingh-01/fix/navbar-active-link
Browse files Browse the repository at this point in the history
Fix active link functionality in navbar for accurate page indication
  • Loading branch information
sampadatiwari30 authored Nov 1, 2024
2 parents 1231cb0 + 9848879 commit f5a5ff3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
🏡</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./about.html" style="color: rgb(237, 242, 244);">About Us 📖</a>
<a class="page-scroll active-link" href="./about.html" style="color: rgb(237, 242, 244);">About Us 📖</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./finance.html" style="color: rgb(237, 242, 244);">Courses 📚</a>
Expand Down
10 changes: 8 additions & 2 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,14 @@ p {
.navbar-nav .nav-item a:hover {
text-decoration: none !important;
}


.active-link {
background-color: rgba(255, 99, 71, 0.2);
border-radius: 5px;
color: #ffffff;
transform: scale(0.95);
border-bottom: 2px solid #edf2f4;
transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.sticky {
position: fixed;
z-index: 99;
Expand Down
4 changes: 2 additions & 2 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
</div>
<ul id="nav" class="navbar-nav ml-auto" style="margin: auto;">
<li class="nav-item">
<a class="page-scroll active-link" href="./index.html" style="color: rgb(237, 242, 244);">Home
<a class="page-scroll" href="./index.html" style="color: rgb(237, 242, 244);">Home
🏡</a>
</li>
<li class="nav-item">
Expand All @@ -371,7 +371,7 @@
<a class="page-scroll" href="./finance.html" style="color: rgb(237, 242, 244);">Courses 📚</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./contact.html" style="color: rgb(237, 242, 244);">Contact📞</a>
<a class="page-scroll active-link" href="./contact.html" style="color: rgb(237, 242, 244);">Contact📞</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./faq.html" style="color: rgb(237, 242, 244);">Help 🙋‍♂️</a>
Expand Down
2 changes: 1 addition & 1 deletion finance.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<a class="page-scroll" href="./about.html" style="color: rgb(237, 242, 244);">About Us 📖</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./finance.html" style="color: rgb(237, 242, 244);">Courses 📚</a>
<a class="page-scroll active-link" href="./finance.html" style="color: rgb(237, 242, 244);">Courses 📚</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./contact.html" style="color: rgb(237, 242, 244);">Contact📞</a>
Expand Down
14 changes: 0 additions & 14 deletions navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ z
-ms-transition: background-color 0.3s ease-in-out;
-o-transition: background-color 0.3s ease-in-out;
} */
.active-link {
background-color: rgba(255, 99, 71, 0.2);
/* Soft coral with slight transparency */
border-radius: 5px;
color: #ffffff;
/* White text for contrast */
transform: scale(0.95);
border-bottom: 2px solid #edf2f4;
}

.navbar-nav {

Expand Down Expand Up @@ -492,11 +483,6 @@ z
width: 0;
}

.mobile-menu .active-link {
background:
linear-gradient(black) bottom/ 100% 2px no-repeat,
transparent;
}

.mobile-menu__trigger {
cursor: pointer;
Expand Down

0 comments on commit f5a5ff3

Please sign in to comment.