PDA

View Full Version : Can links be different colours on the same paqe?


glimmertwin
07-20-2007, 09:41 AM
Hi...first time poster. My problem is simple. I'm building a website (not online yet) and my first sub menu requires the links to all be in white with only a black rollover. However, in many pages there will be submenus that appear on a different part of the page. The problem is, that part of the page is white (and must remain white so as not to spoil the design) and every time I turn text into a link it disappears :(

I want these links to remain grey with maybe a deep red or black rollover

So my question is...can I have links with different colour properties on the same page, and if so...how?

edbr
07-20-2007, 09:55 AM
yes you can how are you with css?
if you search this forum there are a few examples already posted, one in the last 2 weeks

glimmertwin
07-20-2007, 10:03 AM
Thanks for the quick reply! Much appreciated!

I'm still learning by my mistakes with CSS, but I have a pretty good grasp of how and why to use it. Would I be right in assuming that I need to create a new CSS link code that I can then apply much like any other text attribute by giving it an individual name..like "greylink"?

edbr
07-20-2007, 10:16 AM
yes you can apply different attribute to a division or class

glimmertwin
07-20-2007, 10:49 AM
but could you explain what I have to do in slightly more idiot proof language. I have been struggling for the last hour or so, copying the link code and trying to paste it into my style sheet with different colour attributes (which only serves to over ride my initial style and turn everything grey) but with no joy. I've tried creating a new style sheet but again that changes everything on the page when all I wish to do is add a new link code to certain individual tables within my page.

Could you explain how I create some kind of stand alone code I can apply to certain windows so that my links will appear visible? Once again sorry for being a pest... here is the code I would like to apply

.menuwhite11 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #FFFFFF; }
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
a:link {
text-decoration: none;
color: #666666;
}
a:visited {
text-decoration: none;
color: #666666;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
color: #666666;

edbr
07-20-2007, 10:57 AM
sorry running out of time I have to leave but simply put
.menuwhite11 a:link {
text-decoration: none;
color: #000;
}
will give a different a attribute to class .menuwhite11

fwr1000
07-20-2007, 11:50 AM
As ebar was saying, create two classes. Example, .whitelinks with the first link color scheme you want. Then create a second class (.blacklinks) with the second color scheme you want. Then apply the appropriate class to the links, dependant on which color scheme you want for that link.