Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7841971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:12:51+00:00 2026-06-02T16:12:51+00:00

I have the following tabbed navigation setup in my master page. <nav class=grid_12> <ul>

  • 0

I have the following tabbed navigation setup in my master page.

        <nav class="grid_12">
            <ul>
                <li><a href="#" class="selected">Home</a></li>
                <li><a href="#">Portfolio</a></li>
                <li><a href="#">Blog</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
        </nav>

When I click on the Portfolio tab, for example, I’d like the Portfolio tab to remain highlighted when I land on the portfolio page.
What is the recommended way to accomplish this?

I have checked some other posts, but the most relevant of those uses divs in the example as opposed to separate pages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:12:52+00:00Added an answer on June 2, 2026 at 4:12 pm

    Assuming the “selected” class name you have has the styling for the highlight you’re talking about. After the user clicks on one of those links, with jquery you can add “selected” class to the clicked anchor tag. put this at the bottom of your page right before the closing body tag or in your main JavaScript file.

    <script type="text/javascript">
        $(document).ready(function () {
            $(".grid_12 ul li a").click(function() {
                $(".grid_12 ul li a ").removeClass("selected");
                $(this).addClass("selected")
            })
        })
    </script>
    

    The code above will only work if there is no page refresh and only content refresh, however if your page will refresh and go to a new page I would do something like this:

    <nav class="grid_12">
        <ul>
            <li><a href="#" class="nav_home">Home</a></li>
            <li><a href="#" class="nav_portfolio">Portfolio</a></li>
            <li><a href="#" class="nav_blog">Blog</a></li>
            <li><a href="#" class="nav_contact">Contact</a></li>
        </ul>
     </nav>
    

    and add the styling for specific pages. For example when you’re on http://www.mySite.com/portfolio in the css for portfolio ONLY add:

    a.nav_portfolio{
        background-color:orage;
        ...
    }
    

    This way you don’t even have to do any javascript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my template, I have the following: <ul class=tabbed id=network-tabs> {% if user.is_authenticated %}
I have setup some tabbed navigation on my ASP.NET Masterpage. It is pretty basic:
I have following HTML menu: <ul> <li><a href=index.html>Index Page</a></li> <li><a href=#some-page>Some Page</a></li> </ul> Let
Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs
I have the following problem. I have a tabbed application implemented using a ViewPager.
I have following class public class ButtonChange { private int _buttonState; public void SetButtonState(int
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I'm working with a tabbed interface and have the following jQuery function set up
I have a 'tabbed' style web page where once the page loads each tab
I have some html/jQuery that I am using to implement some tabbed navigation. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.