0 votes
by (150 points)

I would like to present a list of links of different color to the player. These are not passage links. I want to control the text color, mouseover color and underline color. I imagine it would be something like this pseudocode:

<<ThisLinkIs "green">><<link "foo">><<DoStuff>><</link>><</ThisLinkIs>>
<<ThisLinkIs "red">><<link "bar">><<DoThings>><</link>><</ThisLinkIs>>

I am aware that a CSS stylesheet exists, but I have have zero knowledge of CSS or HTML. I'm using Twine v2.2.1 and Sugarcube v2.22.0.

Can somebody please show me how to set this up?

1 Answer

0 votes
by (23.6k points)
selected by
Best answer

You can create a custom font style in CSS like this:

.test a { color : red; }

add whatever you want to change there, then use it in the text like this:

<span class="test">[[link]]</span>





by (150 points)
I didn't expect that to work with non-passage links because of the way it was written. But it seems to do what I want, thanks a lot! I will play with this a bit and see if it works out.
by (23.6k points)
edited by

Changing the CSS in this way should work on any kind of link written within the span:

<span class="test">This is a [[sentence]] where <<link "every">><<set $success to true>><</link>> link is red.</span>

For more options about what you can do you should easily find any examples on google. I usually find what I am looking for here.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.