Not Solved Link colour
#1
Not Solved
Hello,

I've searched around and nothing seems to work. Basically I need the code to change the colour of individual links.. I've seen it in themes before, but I can't remember the code.

Example:

<a href="http://google.com">Google</a> - That would show up as just "Google" then with the link, but how do I change that INDIVIDUAL link colour.

I know how to change the link colour in global.css, but that effects all the links, I only want one.

Any help would be great.

Thanks.
Reply
#2
Not Solved
You may use a mycode for this;

This will change the color of individual link.

Regular Expression:
\[link=(.*?)\](.*?)\[/link\]

Replacement::
<span style="color: $1"><a href="$2">
$2</a></span>

Usage::
[link=COLOR]LINK[/link]

Remember:
COLOR = Should be in hex or in words like; #FF0000 for Red or use red / Red words for Red colors.
LINK: You can add link either in www. format or http:// format.
Reply
#3
Not Solved
(2011-01-14, 04:33 PM)Yaldaram Wrote: You may use a mycode for this;

This will change the color of individual link.

Regular Expression:
\[link=(.*?)\](.*?)\[/link\]

Replacement::
<span style="color: $1"><a href="$2">
$2</a></span>

Usage::
[link=COLOR]LINK[/link]

Remember:
COLOR = Should be in hex or in words like; #FF0000 for Red or use red / Red words for Red colors.
LINK: You can add link either in www. format or http:// format.

I don't mean in threads, I mean on the homepage, like the footer copyright for example.
Reply
#4
Not Solved
Then you may edit each link like;
<span style="color: COLOR"><a href="LINK_URL_GOES_HERE">LINK_TEXT</a></span>
Reply
#5
Not Solved
Tried that: <span style="color:#000000;"><a href="http://www.mybb.com">MyBB</a></span>


But it doesn't work...
Reply
#6
Not Solved
Try instead this slightly less stupid version:

<a href="url" style="color: hexOrName;">Link</a>

Or, if that doesn't work exactly like you want, try these:
/* global.css */
#myID:link, #myID:visited {
    color: hexOrName;
}

#myID:hover, #myID:active {
    color: anotherColor;
}

/* Template */
<a href="url" id="myID">Link</a>

The second method may be more complicated but it offers far more control than the first.
[Image: LogoO.png]
Reply
#7
Not Solved
(2011-01-14, 07:30 PM)iGeorge Wrote: Tried that: <span style="color:#000000;"><a href="http://www.mybb.com">MyBB</a></span>


But it doesn't work...

You are adding ; after the color code. Remove it.
Reply
#8
Not Solved
@Yaldaram - Even without the ";" it didn't work.

Firestryke31's first method worked though.

Thanks.
Reply
#9
Not Solved
(2011-01-15, 06:41 AM)Yaldaram Wrote: You are adding ; after the color code. Remove it.

The ';' is simply an "end of attribute" marker, and if a browser fails because of that being present then it is not a CSS-compliant browser.

I tend to add the ';' in case I want to add more attributes after that, but for only a single attribute it's not necessary in the tag's style.
[Image: LogoO.png]
Reply
#10
Not Solved
That's why I didn't added Toungue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)