H I O X INDIA
FREE CSS Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
Español  Français  中文  Deutsch 
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
More about CSS
Feedback




Visited Link Colors


Topic

How to set a different color for visited and unvisited links?
I want to have link with no underlines?



Explanation

Property: a:visited


Many a times we will want our links to show different colors.
We might want our visited links to be shown in red color and font size as 10px.
We might want our non-visited links to be shown in green color and font size as 15px.

This can be achieved by using internal style coding
For this, in the header portion add the style as

<style>
a{color: green; font-size: 15px}
a:visited{color: red; font-size: 10px;}
</style>

Definition:
We can set the link property for visited links using the tag "a:visited".
We can set any property (text, box, font, background properties).

Example:
The below links will give you the result:
The first link is some dummy value so it will be treated as a non-visited link.
The second link is for the same page("others.php") which is the visited link.

This is non-visited link

This is visited link



No underline Link:

       Here we will show how to create links with out any underline
We use the attribute "text-decoration: none;" to handle it.

Example:
<a href="http://www.hscripts.com" style="color: orange; font-size: 15px; text-decoration: none;">
Creating Link without a underline
</a>


Result:
Creating Link without a underline






A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com