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 7624933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:07:30+00:00 2026-05-31T05:07:30+00:00

Ok so I have the follow menu: <div class=header> <div id=logo></div> <ul class=menu> <li><a

  • 0

Ok so I have the follow menu:

<div class="header">
        <div id="logo"></div>
        <ul class="menu">
            <li><a href="/index.aspx">Home</a></li>
            <li><a href="/about.aspx">About</a></li>
            <li><a href="/contact.aspx">Contact</a></li>
        </ul>
    </div>

Associated with this CSS class:

.header {
    margin:20px 0 55px;
    height:68px;
    width:inherit;
}

What can I put in my menu tag or my CSS class to make the link not change colors when it is clicked. Currently the link will be blue but once it has been clicked it turns purple. I want it to be say black all the time, clicked or not.

  • 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-05-31T05:07:31+00:00Added an answer on May 31, 2026 at 5:07 am

    No better way than to quote the specs:

    a:link    { color: red }    /* unvisited links */
    a:visited { color: blue }   /* visited links   */
    a:hover   { color: yellow } /* user hovers     */
    a:active  { color: lime }   /* active links    */
    a:active  { color: gray }   /* when element accepts tab focus */
    

    http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes

    So this should cover all cases:

    .header a,
    .header a:link,
    .header a:visited,
    .header a:active,
    .header a:hover {
        color: black;
    }
    

    http://jsfiddle.net/ZgUZn/1/

    Joerg noted in a comment below the question that I omitted :focus. I did, and for a reason, but I’ll note why and you can consider if you need it or not:

    .header a:focus {
        color: white;
        background: blue;
        font-size: 2em;
    }
    

    http://jsfiddle.net/ZgUZn/5/

    Go to that link, click in the white part of the page in the bottom, right quarter, then hit the TAB key. You’ll see that when that element receives focus, it changes. You can cover that by including this psuedo-class, but it’s my understanding that browsers do not have a default setting for this, so unless you set it somewhere else and you need to cancel it out, it might be unnecessary.

    NOTE: I seem to remember in the back of my mind recently I found out that just .header a may also work, but honestly I’m not sure how, and I’ve always understood the above is how it should be done (belt-and-suspenders notwithstanding). Comments welcome on this point.

    EDIT

    As to the above note, I think I’ve got an answer:

    a,
    a:link,
    a:visited,
    a:hover,
    a:active {
        background: green;
        color: white;
        font-size: 2em;
    }
    .header a {
        color: black;
    }
    

    http://jsfiddle.net/ZgUZn/6/

    The .header a does not override all of the psuedo-selectors if they have been declared elsewhere. Now, if there aren’t any others declared, it appears to work in overriding the browser’s defaults, but that may be a false-positive.

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

Sidebar

Related Questions

I have a menu: <div class=headerMenu> <ul> <li><a href=#>Home <span>Home Page<span></a></li> <li><a href=#>About <span>About
I have my div as follows <div class=menu id=admindiv runat=server> <ul> <li><a href=>welcome to
I have the follow structure: <div class=cardapio-content> <h5>Tittle of tab 1</h5> <p>Content of tab
I have a follow-up question to this one . I created a new form,
I have a follow up question to this question . Is it possible to
i have the follow code: searchResults.SearchResultCollection.Add( new SearchResult() { Header = HttpUtility.HtmlDecode( htmlDocument.DocumentNode .SelectSingleNode(initialXPath
I have a follow up question to this one . Now that I have
I have a dropdown menu system setup such as this... This is the scripting
Hello all i have made a tab menu in my sidebar (follow a tutorial),
I dont what is going on but I have this menu set like this

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.