Jump to content

a:selected doesn't work.


nashsaint

Recommended Posts

Hi,

 

I have a problem with my menu, it's only a simple text menu with simple text decorations.  the link, hover and active works but the selected doesn't.  When a link is clicked it only shows the "a" state.

 

This menu is saved on header.php which is then called by pages using php include command.

 

#navbar a {

font-family: Verdana, Geneva, sans-serif;

color: #FFF;

text-decoration: none;

}

#navbar a:hover {

text-decoration: underline;

color: #202020;

}

#navbar a:active {

color: #333;

font-style: italic;

}

#navbar a:selected {

color: #202020;

text-decoration: underline;

}

 

help is greatly appreciated.

 

thanks.

Link to comment
Share on other sites

If you are looking for "visited" then make sure to do it like this:

 

#navbar a {
   font-family: Verdana, Geneva, sans-serif;
   color: #FFF;
   text-decoration: none;
}
#navbar a:visited {
   color: #202020;
   text-decoration: underline;
}
#navbar a:hover {
   text-decoration: underline;
   color: #202020;
}
#navbar a:active {
   color: #333;
   font-style: italic;
}

 

LoVe HAte - For the links to work properly in some browsers, you need to put the psuedo classes in that order.

 

If you are trying to style the "current" tab that applies to the current page:

 

You need to add a "current" class to the <li> or <a>

 

<ul>

<li class="current"><a href="#">Currently styled link</a></li>

<li><a href="#">Normal link</a></li>

</ul>

 

#navbar a {
   font-family: Verdana, Geneva, sans-serif;
   color: #FFF;
   text-decoration: none;
}
#navbar a:visited {
   color: #202020;
   text-decoration: underline;
}
#navbar a:hover {
   text-decoration: underline;
   color: #202020;
}
#navbar a:active {
   color: #333;
   font-style: italic;
}
#navbar li.current a {
styled properties...
}

Link to comment
Share on other sites

a:selected doesn't exist as far as i know, and it would still not disable the link.

 

To "disable" the link, you would need to remove the a tags for the requested page, on the server-side. Remember that a link to the same page is bad, unless its a section link.

 

 

Not as bad as some people suggest however, since you could just throw in a nofollow attribute for SE's, and style them differently. But then the question comes up, why you would have a clickable link to the same page in the first place.

 

If using lists, then i suggest simply removing the a tags, this also requires less styling. You could also shift the a tags with a normal paragraph, whenever POSTID == REQUESTEDID..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.