multiple link colors

liunx

Guest
Ok I know how to do a CSS style to format all the links on a page, but as seen here (<!-- m --><a class="postlink" href="http://nb3.gamingbattleleague.com/example.html">http://nb3.gamingbattleleague.com/example.html</a><!-- m -->) I have 4 different colors, all of which will be links, how can I format it to do this? Thanx for any help.<!--content-->set up different classes for each link, a quick example being:<br />
<br />
<br />
<style type="text/css"><br />
<br />
a.y:link {color: #ECFB03; text-decoration: none; }<br />
a.y:visited {color: #ECFB03 ; text-decoration: none; }<br />
a.y:hover {color: #ff0000; text-decoration: none; }<br />
a.y:active {color: #ECFB03; text-decoration: none; }<br />
<br />
<br />
<br />
</style><br />
<br />
<br />
and the class called in like this:<br />
<a class="y" href=http://www.htmlforums.com/archive/index.php/"yourpage.html">linktext</a><br />
<br />
<br />
:)<!--content-->\o/ Thanx, worked great :)<!--content-->You could also export the CSS to an external file and call it with a one line instruction in the <head>:<br />
<br />
<link type="text/css" rel="stylesheet" src=http://www.htmlforums.com/archive/index.php/"/path/file.css"><br />
<br />
This would mean that the whole web site then shares that style file, rather than having to set it up on each page.<!--content-->Just found this via search...<br />
<br />
This will save me quite a few chars per link since I have been using 'span class' tags inside each link to change colors, however...<br />
<br />
Is there a way to make changes at the block level?<br />
<br />
What I really need, for example, is to have a different color for each link _table_ that I have, or just certain segments of the page.<!--content-->sure, it SHOULD inherit on down. i use <span> or <div>. although with classes, sometimes you have to try different methods (i usually use .name:hover), massage it a little to make sure it works across IE and Mozilla.<!--content-->you don't have to use span inside a link aswell, just place it all into the link css<br />
<br />
a.y:link {color: #ECFB03; text-decoration: none;font-family:verdana...... }<br />
a.y:visited {color: #ECFB03 ; text-decoration: none;font-family:verdana...... }<br />
a.y:hover {color: #ff0000; text-decoration: none;font-family:verdana...... }<br />
a.y:active {color: #ECFB03; text-decoration: none; font-family:verdana......}<!--content-->Originally posted by transmothra <br />
sure, it SHOULD inherit on down. i use <span> or <div>. although with classes, sometimes you have to try different methods (i usually use .name:hover), massage it a little to make sure it works across IE and Mozilla. <br />
I was still having some trouble with this, so I found a tip on another board and thought I'd post it here for future reference.<br />
<br />
I guess it's just a twist on what you have.<br />
<br />
.name a { Color : #FF99FF }<br />
<br />
I put it inside my table tag and it works like a charm!<!--content-->this is why we learn to use the search function, this answered my question perfectly on links :D<!--content-->
 
Back
Top