answersLogoWhite

0

You may not know it, but a link has four different states that it can be in. CSS 2.1 allows you to customize each state. Please refer to the following keywords that each correspond to one specific state:

* active - this is a link that is in the process of being clicked

* focus - applies a style to an element in focus

* hover - this is a link currently has a mouse pointer hovering over it/on it

* 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

* first-child - special style to an element that is the first child of another element

* lang - specifies a language for the specified element

Order matters. If "a:active" precedes "a:hover", the effects in "a:hover" will take precedence. So, in this example, you would not see the color change when the user clicks down on a link.

Pseudo Classes

You can set links contained in different parts of your web page to be different colors by using the pseudo class. For example, lets say you want your links in the content area to have a different color then the links in the left or right column of your webpage.

You can do this in the following fashion:

#content a:link {color: #009900;}

#content a:visited {color: #999999;}

#content a:hover {color: #333333;}

#content a:focus {color: #333333;}

#content a:active {color: #009900;}

Now assuming that you have your main content in a division named "content" all links within that division will now be styled by this new style selector. Should your selector have a different name, just change the #content selector to match your division name.

Then for the links in a column you could use the following:

#column a:link {color: #009900;}

#column a:visited {color: #999999;}

#column a:hover {color: #333333;}

#column a:focus {color: #333333;}

#column a:active {color: #009900;}

Once again, this assumes the name of the column division, just change the name to match yours.

This same method can be accomplished by declaring a class instead of an id.

a.column:link {color: #009900;}

a.column:visited {color: #999999;}

a.column:hover {color: #333333;}

a.column:focus {color: #333333;}

a.column:active {color: #009900;}

Though in this case you will need to add a class to each link

<a class="column" href="" title="">some link text</a>

But, there is still yet an easier way

.column a:link {color: #009900;}

.column a:visited {color: #999999;}

.column a:hover {color: #333333;}

.column a:focus {color: #333333;}

.column a:active {color: #009900;}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What type of style sheet uses the style tag?

CSS (Cascading style sheet)


What is the fullform of CSS?

cascading style sheet


What dpes CSS stamd for?

Cascading Style Sheet


What is the use of cascading style sheet in web development?

Cascading Style Sheet is a way of styling your document. It is a set of commands which make a page much more interactive.


What is cascading style script?

CSS (Cascading Style Sheet) is a proramming language that is used with HTML to create the layout of a page.


What is the meaning of cascading?

The cascading that is referred to in the name cascading style sheets refers to how rules can cascade in how they are implement. CSS rules can be found in three places: an external style sheet, and internal style sheet, or inline. Cascading refers to precedence. A rule located inline, will take precedence over a rule located in an internal style sheet and a rule located in an internal style sheet will take precedence over a rule located in an external style sheet. Within a single style sheet (for example an external style sheet) a rule located at the bottom of the style sheet takes precedence over a rule located at the top of the style sheet. This allows you fine tuned control over your styles and how and when they display and which one will display based upon where in the cascading hierarchy they appear.


What does the css stand for in photoshop css?

Cascading Style Sheet


What does the acronym CSS mean?

(if you mean the style sheet language) Cascading Style Sheets


What contains the formats for how a particular object should display in a Web browser?

cascading style sheet (CSS)


how many foundation tags are there in HTML?

Foundation is a kind of Cascading Style Sheet. It is also called as Zurb Foundation.


What doas css mean?

CSS stands for Cascading Style Sheet, which makes websites beautiful, simply saying.


What is the file name extentesion of an externel style sheet?

An external style sheet written to the Cascading Style Sheet standards will have a .css file extension. If you are using notepad you will have to manually set this as the file extension. Most web editors will allow you to select this extension when you go to save the file.