Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stylesheet definition help

Status
Not open for further replies.

vivekm

Programmer
Oct 4, 2000
76
GB

Hi,

I am trying to understand the relationship between defining the stylesheet styles and using them. For example, in the ibuyspy sample application, the following styles are defined in portal.css file:
A.OtherTabs:link
A.OtherTabs:visited
A.OtherTabs:active
A.OtherTabs:hover

From the theory sections, all I can understand is that 'A' is the Element and 'OtherTabs' is the Class. When this style is being used in the code, only the Element is referred to. E.g.
<a href='...' class=&quot;OtherTabs&quot;>...

Questions are:
1. What is the bit after the colon? Is there a list of valid values for the bit after the colon?
2. When the styles are being referenced, the bit after the colon is not specified. At runtime, is the bit after the colon used at all? If so, how is it mapped?

Thanks in advance,
Vivek



 
A - the element
OtherTabs - the class name
:link, :visited, :active, :hover - various events of the element

A hyperlink has a few different properties to it: you can have it at its default state, it can have been visited already, you can hover your mouse over it.

Each of thsee can have its own css spec.

So for instance, If I was the author of IBUYSPY, and I wanted a different set of links to have a different spec, I could just write:
A.EvenMoreTabs:link
A.EvenMoreTabs:hover

and apply that class to a different set of links that i want to have a idfferent look.

hth

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top