answersLogoWhite

0


Best Answer

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

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

well you have Pseudo-class:

In CSS, a pseudo-class is way of selecting certain parts of a HTML document based in principle not on the HTML document tree itself and its elements or on characteristics like name, attributes or contents, but on other phantom conditions like language encoding or the dynamic state of an element. The original pseudo-class defined dynamic states of an element that are entered and exited over time, or through user intervention. CSS2 expanded on this concept to include virtual conceptual document components or inferred portions of the document tree e.g. first-child. Pseudo-classes operate as if phantom classes were added to various elements.

and Pseudo-element:

In CSS, pseudo-elements are used to address sub-parts of elements. They allow you to set style on a part of an element's content beyond what is specified in the documents. In other words they allow logical elements to be defined which are not actually in the document element tree. Logical elements allow implied semantic structure to be addressed in CSS selectors.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is Pseudo-classes in cascading style sheet?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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 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 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 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)


What doas css mean?

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


how many foundation tags are there in HTML?

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


How are the conflicting style rules resolved for the same element in HTML?

The conflicting style rules are resolved by introducing internal and external CSS. It defined a common cascading style sheet for all.