asp.net.ph

Skip Navigation Links

visited Pseudo-class

CSS Attributes Index   Pseudo-class Attributes


Sets or retrieves the style of previously visited hypertext links ( anchor elements ) in a document.

Syntax


CSS [ A ] :visited { attribute1:parameter1 [ ; attribute2:parameter2 [ ; . . . ] ] }
Script N/A

Possible Values


attribute Any attribute applicable to text.
parameter Any of the range of values available to the corresponding attribute.

This pseudo-class is read/write with a default value that is browser-specific.

Remarks

Visited means that the user has previously navigated the link. Setting the visited pseudo-class is often used in conjunction with the following pseudo-elements to define the various states of a link: active, link, and hover.

Using pseudo-classes on elements other than the A element has no effect.

Example

The following demonstrates use of the a:visited attribute in an embedded stylesheet to set the color of visited hyperlinks on a page.

<style type="text/css">
   a:link {
      font-weight: bold; color: #8be }
   a:visited {
      color: #eb8 }
   a:active {
      background-color: #eec; color: #500 }
   a:hover {
      color: #bc7; text-decoration: none;
      font-variant: small-caps }
-->
</style>

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 

The CSS :visited attribute can also be used for contextual hyperlinks, or links which are contained within other elements or selectors. For instance:

ul a:link, ul a:visited {
   font: bold 11pt Arial; color: #9cf;
   text-decoration: none }
.showme a:link, .showme a:visited {
   font: bold 11pt arial; background: navy; color: lime;
   text-decoration: none; padding: 3 }

That declaration will apply the style to all links within an unordered list ( UL ) element, as well as to elements whose class attribute is set to showme.

Applies To

A

See Also

active, hover, link



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note