Can I specify the colour for specific links on a page that overides the page properties?
The words coloured orange throughout the page I would like to make links but as soon as I do they default to the page colour, how do I kkep the original colour and underline them?
http://www.nick-lawrence.co.uk/packages.html
Many thanks
Nick
Sure.
Change all instances of <span class="line">Your text here</span> to <a href="LinkHere" class="line">Your text here</a>.
Then modify your .line css to read
a.line {
color: #F90;
text-decoration:none;
font-family: Arial, Helvetica, sans-serif;
}
a.line:hover {
color: #F90;
text-decoration:underline
font-family: Arial, Helvetica, sans-serif;
}
Use CSS Pseudo-classes - Link States
You need to define a set of link states (link, visited, hover, active) for each ID or class name required.
Let's say you want to have red links in your #header and white links in your #footer.
CSS:
#header a {text-decoration:none}
#header a:link {color:red} /**unvisited**/
#header a:visited {color:gray} /**visited**/
#header a:hover, /**on mouse over**/
#header a:active, /**on click**/
#header a:focus /**on tab key**/
{text-decoration:underline}
#footer a {text-decoration:none}
#footer a:link {color:white}
#footer a:visited {color:yellow}
#footer a:hover,
#footer a:active,
#footer a:focus
{text-decoration:underline}
HTML:
<div id="header">
<a href="some-link.html">Link in the header</a> |
<a href="some-link.html">Link in the header</a> |
<a href="some-link.html">Link in the header</a> |
</div>
<div id="footer">
<a href="some-link.html">Footer link</a> |
<a href="some-link.html">Footer link</a> |
<a href="some-link.html">Footer link</a> |
</div>
For more on CSS pseudo classes:
http://www.w3schools.com/css/css_pseudo_classes.asp
Nancy O.
North America
Europe, Middle East and Africa
Asia Pacific