ID:260226
 
I believe we should be able to change what colour links (like this) look like in the Dream Seeker text box. Since my game uses a dark-grey background, blue font is hard to see, so I'd prefer to change links to a different colour.

~~> Unknown Person
If you mean the actual DS text box (That link you provided is confusing me), then you can use styles for that:
client/script={"
<STYLE>
.AllBlue, .AllBlue a {color:#0000FF}
.AllRed, .AllRed a {color:#FF0000}
.AllGreen, .AllGreen a {color:#00FF00}
</STYLE>"}


And then when you want to set a link color:
src<<{"<span class="AllRed">This text is red. <a href=www.byond.com>This link is red</a>.  <span class="AllGreen">This text is green. <a href=www.members.byond.com>This link is green</a>."}


If not, can you please elaborate?
In response to DarkCampainger (#1)
DarkCampainger wrote:
If you mean the actual DS text box (That link you provided is confusing me), then you can use styles for that:

You actually can't use CSS for that in the DS text box. The link was just to show what colour a linked text looks like, so ignore where it goes to.

~~> Unknown Person
CSS properties that are already supported in DS Text Box

A:link, A:visited
A:active


CSS properties not supported:

A:hover


CSS2 Reference @ w3schools.com
In response to Jtgibson (#3)
Jtgibson wrote:
CSS properties that are already supported in DS Text Box

A:link, A:visited
A:active

If they were actually suppported, wouldn't this work?

client/script = {"

&lt;style&gt;
A:link, A:visited, A:active
{
color: #ff0000;
};
&lt;/style&gt;

"}


I tried doing that before, however, it never worked when I tried to use <a> tags. They always displayed the link as blue.

~~> Unknown Person
In response to Unknown Person (#4)
This works for me:
client/script={"
&lt;STYLE&gt;
a {color:#CCCCCC}
.AllBlue, .AllBlue a {color:#0000FF}
.AllRed, .AllRed a {color:#FF0000}
.AllGreen, .AllGreen a {color:#00FF00}
&lt;/STYLE&gt;"}

mob/verb/test() src<<{"This text is default! <a href=www.google.com>This link is default</a>! <span class="AllRed">This text is red. <a href=www.byond.com>This link is red</a>.</span> <span class="AllGreen">This text is green. <a href=www.members.byond.com>This link is green</a>.</span>"}


Have you tried it since? There may have been a small update that added it that was never mentioned.
In response to DarkCampainger (#5)
I see what the problem is now. It looks like you're only able to change the colour of <a> links if the background isn't set to anything but default. If you add a "body { background: '#000000'; };" to your example, your coloured links will stop working.

[edit] With more testing, I figured out that the background doens't necessarily need to be non-default. If anything in the body part is set, the links won't be coloured.

~~> Unknown Person
In response to Unknown Person (#6)
Which order are you doing your CSS settings in? CSS is dependent on the order of the elements.

I use a background colour in Haven and my coloured links work just fine.

haven.dms:
<code> <style> body {color: #333300; background-color: #DDCC99; font-family: "Times New Roman", serif; font-size: 12pt} h1 {text-align: center} .system {color: #FF0000; font-family: "Courier New", Courier, monospace; font-size: 8pt} .comm {color: #3333CC} .emote {color: #33BB33} .combat {color: #BB3333} .debug {text-decoration: underline; color: #990000} .ooc {color: #808000} .faded, a.faded:link {color: #D0C090} A:link {text-decoration: none; color: #666633} A:visited {text-decoration: none; color: #666633} A:hover {text-decoration: underline; color: #FFFFFF} A:active {text-decoration: underline; color: #FFFF00} </style></code>

I have the hover setting in there just so it'll work automatically if support is ever added. ;-)