To add effects to your anchor tags,CSS is used , otherwise known as hyperlinks.
With the addition of CSS, javascript links can be forgotten.In HTML, the only way to add this effect would be to use javascript,
CSS Anchor/Link States
You may not know it, but a link has four
different states that it can be in.To customize
each state, CSS is used. Please refer to the following keywords that each
correspond to one specific state:
link - this is a link that has not been used, nor
is a mouse pointer hovering over it
visited - this is a link that has been used
before, but has no mouse on it
hover - this is a link currently has a mouse
pointer hovering over it/on it
active - this is a link that is in the process of
being clicked
You can make a different look for each one of these
states using CSS, but at the end of this lesson we will suggest a good
practice for CSS Links.
CSS Pseudo-Classes
what you've seen is a little different than the format for CSS Links . You have to use the following CSS code formatting to modify these 4 states
CSS Code
a:(STATE'S NAME) { attribute: value; }
How the HTML element should appear, depending on which state it is in ,the state's name which is called the "pseudo class" is uesd. Below is an example of changing the "link", "visited", and "hover" state. Note to make a functioning CSS link,the order that they are defined, it is the proper ordering.
The states must be defined in the correct order. Here is the order, starting with the one you must define first:
1.link
2. visited
3.hover
4. active
Removing the Default Underline
Throughout academic-tutorial.com you probably have
noticed the different styles that we have for certain links. Unless you are hovering, our
menu's do not have an underline while
the links in our main content do have underlines. Use
text-decoration: none to remove the
underline from certain states of a hyperlink,.: