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

  • Home
  • SEARCH
  • 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 8367823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:15:11+00:00 2026-06-09T13:15:11+00:00

I am currently in the process of adding a navigation bar to a test

  • 0

I am currently in the process of adding a navigation bar to a test site. I have seen some navigation bar indicate the current selected page by adding a bar underneath or glow to the <a> tag. I am right now puzzled in the right way to achieve such css style. How can i achieve a glow effect around a selected <a> so the user will now the page they currently at? EXAMPLE

Thank you

For my <a> tags i have created a .buttonNav class

CSS related rules for navigation bar:

<style>
/**************  Header Styling ****************/
#navigation {
    left: 440px;
    margin-top: 80px;
    position: relative;
}


#contentNav { color: #cfdae3; }
/* Dark Button CSS */
.buttonNav {
    outline: 0;
    padding: 5px 12px;
    display: block;
    color: #EBEBEB;
    font-weight: bold;
    text-shadow: 1px 1px #1f272b;
    border: 1px solid #1c252b;
    border-radius: 3px;
    background: #232B30;
}
.buttonNav:hover {
    color: #fff;
    background: #4C5A64; 
}
.buttonNav:active {
    background-position: 0 top;
    position: relative;
    top: 1px;
    color: #fff;
    padding: 6px 12px 4px;
    background: #20282D; 
    box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
}
.button-list {
    list-style: none outside none;
    overflow: hidden;
}
.button-list li { float: left; margin: 0 5px 0 0; }
.button-list li.search { padding-left: 18px; margin-left: 10px; position: relative; list-style: none outside none;}

</style>

HTML

<div id="header">
  <div class="search"><input type="text" class="search-input" name="search" value="Search" onclick="$(this).val('');" /><input type="submit" class="search-submit" /></div>
  <div id="navigation">

   <ul class="button-list">
       <h2>MAIN TITLE PAGE</h2>
    <li><a href="http://webprolearner2346.zxq.net/css-test2/index.php" class="buttonNav" >Content 1</a></li>
    <li><a href="http://webprolearner2346.zxq.net/css-test2/content2.php" class="buttonNav" >Content 2</a></li> 
   </ul> 
  </div>
 </div>
  • 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-09T13:15:12+00:00Added an answer on June 9, 2026 at 1:15 pm

    I would put in some jquery to handle this automatically something like

      $(document).ready(function () {
          var str = location.href.toLowerCase();
          $(".navigation li a").each(function () {
              if (str.indexOf(this.href.toLowerCase()) > -1) {
                  $("li.highlight").removeClass("highlight");
                  $(this).parent().addClass("highlight");
              }
          });
      })
    

    This function will add a css class highlight to the active li a element. IF and only if the name of the next page is the same as the text. So if the link is called “Product.html” you’ll want the text of the a element to be “Product”

    the an example of the HTML

    <ul class="navigation">
        <li class="highlight"><a href="index.html">Home</a></li>
        <li><a href="product.html">Product</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
    </ul>
    

    the css would change the background color slightly.

    .highlight{
        background-color: #fff;
    }
    

    you know or put in the glow effect you want

    hope this helps,

    EDIT: working tutorial/demo http://blog.huidesign.com/automatically-highlight-current-page-in-navigation-with-css-jquery/

    EDIT2: thanks to Sven Bieder, for helping better understand.

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

Sidebar

Related Questions

I'm currently in the process of adding JNI functionality into a legacy delphi app.
We currently have a process where we receive an inventory file from a vendor
I'm currently in a process of creating a new C project and I have
I am currently in the process of updating many test sites on an old
We're in the process of adding DFS to our network setup and have a
I'm in the process of adding some much needed client side form validation to
I currently have a LARGE single-page application, with each html view being built purely
I'm currently in the process of updating a site from preview 2 of ASP.NET
I have written a Firefox extension and am currently in the process of updating
I'm in the process of writing some epub creation functionality using php5. Currently I

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.