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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anchor tag stylesheet

Status
Not open for further replies.

spicysudhi

Programmer
Nov 10, 2003
575
FR
Hi,

I want to make difference of some anchor A tags within TD tags, like their color, hover/visited. However the rest of anchor tags should remain unchanged, they are using default A tag style sheet definition say as below

A
{
color="#0000ff";
TEXT-DECORATION: none
}

And I have td tag also in style sheet
TD
{
FONT-WEIGHT: normal;
FONT-SIZE: 12px;
FONT-FAMILY: Verdana, Arial
}

I want extend these two tags to use say one A tag in one TD has a different behaviour to another.

can someone suggest me how can i get this.

thanks.
sudhi
 
CSS doesn't change behaviour it changes styling.

If you want to change the behaviour use Javascript.

If you want to change the styling, use a class.

For example
Code:
.myclass {
 color:#f00;
}

Code:
<td><a class="myclass" href="/somelink.html">Blah</a></td>


If you want to change ALL the <a> tags within <td>s different to 'normal' <a> tags then use descendent selectors, like so

Code:
td a {
 color:#f00;
}

<honk>*:O)</honk>
Designease Ltd. - polyprop folders, ring binders and creative presentation ideas
Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Actually, if it's just one link you want to change then you may want to use an ID.

Code:
#mylink {
 color:#f00;
}


And ID must be unique. Only one element in a document can use it. It identifies that element.

If you want to group a collection of style rules into an easy to apply rule and apply to a number of elements then use a class as outlined in my other post.

<honk>*:O)</honk>
Designease Ltd. - polyprop folders, ring binders and creative presentation ideas
Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top