This is a discussion on "Link Colours" within the Web Page Design section. This forum, and the thread "Link Colours are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Link Colours
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Link Colours
Hi, basically I have a number of links on a page which I want to have different colours. How do I get so when I define the a: property in the stylesheet it displays the colours intended instead of the the link colour which automatically generates.
I want a number of different links to have different colours, instead of the standard colour set. What do I have to do to <a> tag. Thanks |
|
|
|
#2
|
|||
|
|||
|
Re: Link Colours
a:link {}
a:visited {} a:hover {} a:active {} or... #foo a {} #foo a:hover {} etc etc
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#3
|
|||
|
|||
|
Re: Link Colours
If you want every link to have a different colour set, then you will have to give each link an id and set up its colour set like the #foo example above.
If you have groups of links that you want to have different colour sets, then set up classes, ie.,
|
|
#4
|
||||
|
||||
|
Re: Link Colours
I'll go a little further since you're a beginner. If you wanted some links to be black and underlined, and another red with no underline, this code would do it:
|
|
#5
|
|||
|
|||
|
Re: Link Colours
Just chipping in to say, if the colours have certain meanings, make the meaning the class name. For example, if the red links are red because they're more urgent, make "urgent" the name of your class.
Some more practical advice - along with a million other CSS coders, I was caught out by the fact that if a:hover appears before a:visited in the style sheet, the link remains the a:visited colour even when the cursor is hovering over it. This is because whenever style declarations conflict, the last one listed prevails... but the consequent effect is not the one you'd want, normally. So be careful about your ordering, and swap as necessary. |
![]() |
| Tags |
| link, tag |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Colours | alexgeek | Website Planning | 15 | Dec 18th, 2007 15:11 |
| Colours | crackafaza | Website Planning | 5 | Sep 13th, 2007 13:27 |
| Alternate Colours | mikka23 | Web Page Design | 5 | Nov 21st, 2006 16:02 |
| Web Safe Colours | Smokie | Web Page Design | 17 | Sep 11th, 2003 22:10 |