Assigning CSS Class to LinkButton

T

Terry Holland

This is probably not the best group for this but I'll give it a go.

I am creating a couple of menu type controls. I have a TopMenu and a
PageMenu.
These controls are formed of a table with a number of cells containing
LinkButtons and ImageButtons.
Generally my TopMenu has a Navy background colour, so any links on these
need to be white in colour.
Generally my PageMenu has a White background colour. The trouble I am
having is that I dont seem to be able to have the links on this control a
different style to the links in the TopMenu control -ie white text (no good
on white background).

In my TopMenu I have the following

With objLinkButton
.ID = intIndex
.Text = objMenuInfo.Text
.CommandArgument = objMenuInfo.Url
.CommandName = intIndex
.CssClass = "Link1"
End With

and in my PageMenu control I have the following

With objLinkButton
.ID = intIndex
.Text = objMenuInfo.Text
.CommandArgument = objMenuInfo.Url
.CommandName = intIndex
.CssClass = "Link2"
End With

When I display the pages the only attributes that are applied to my links
from Link1 & Link2 classes are the font-size and font-weight attributes. The
colour is determined by the definitions in the A: Link, A: Hover classes etc.

Could someone advise me how to set up style for my links so that I can have
different link, visited, active and hover styles depending on whether my link
is in a TopMenu or a PageMenu.

In my stylesheet I have the following


A:link {
text-decoration: none;
color: white;
}

A:visited {
text-decoration: none;
color: white;
}

A:active {
text-decoration: none;
color: white;
}

A:hover {
text-decoration: none;
color: #3333cc;
}

..Link1 {
font-size: 12px;
font-weight: bold;
color:White;
}

..Link2 {
font-size: 12px;
font-weight: bold;
color:Navy ;
}


If no-one can answer here please suggest a better group for this question

tia

Terry Holland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,268
Latest member
AshliMacin

Latest Threads

Top