Page 1 of 1

how do I make one link a different color from the rest?

Posted: Thu Feb 11, 2010 9:36 pm
by leftcoast_mike
I've been asked to work on some html which kinda seemed simple with the first few items but this one has me stumped.

I have a css that specifies ALL links have text that's black in color. What I'm trying to do is make one specific link red.


Here's the CSS including the anchors and the style I THOUGHT would work (u2utxt).

Code: Select all

<style type="text/css">
 
 
body {
    scrollbar-base-color: $altbg1;
    scrollbar-arrow-color: $header;
}
 
 
a{
    color: $link;
    text-decoration: none;
}
 
 
    a:hover {
    text-decoration: underline;
}
 
.u2utxt{
              font-size: 10px;
              font-family: $font;
              font-weight: bold;
              color: red;
}
 

here's the html I'm dealing with. I'm trying to keep the $newu2umsg from being included in the anchor and then make it red.

Code: Select all

 
<table border="0" cellspacing="1" cellpadding="0" width=$tablewidth class=header>
<tr><td width="74%" $topbgcode>
<table border="0" width="100%" cellpadding="0" cellspacing="0" background=images/vcc/NewRobEli.jpg>
<tr><td align="left" valign="top" rowspan="2"><a href="http://www.vancouvercivics.com/home.php"><img src="images/pixel_clear.gif" alt="$bbname" border="0" height=146 width=200/></a><br /></td><td align="right" valign="top"><br/>
<font class="smalltxt">$lastvisittext</font><br />
<font class="u2utxt">$newu2umsg</font></tr>
<tr>
 
I really appreciate any help anyone can offer :)

thanks!

Re: how to keep something away from an anchor

Posted: Thu Feb 11, 2010 10:08 pm
by daedalus__
your post is incredibly confusing.

if all links are black:

Code: Select all

 
a
{
    color: black;
}
 
and you want a red one then make a class

Code: Select all

 
a.red
{
    color: red;
}
 

Code: Select all

 
<a href="empty"></a>
<a href="empty"></a>
<a href="empty"></a>
<a href="empty"></a>
<a href="empty"></a>
<a href="empty"></a>
<a href="top" class="red"></a>
 
im very confused but what you mean by "keep one link away from this anchor". links are anchors. that's the name of the tag. also confused about "mini functions that open pages"? what? i didn't see any javacsript.

Re: how do I make one link a different color from the rest (CSS)

Posted: Thu Feb 11, 2010 11:05 pm
by leftcoast_mike
sorry, its still confusing to me too.

there's a theme setup for the forum I'm working on and every single link has black text...including one that pops up in the corner to notify someone that they have a private message.

I'd like to keep all of the links black, except the one for the private message which I'd like to be red.

in the css there's a single style for all linked text. I can't seem to override it and make my one link red.