Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Formatting Single Links

Hello all, pfm2001 here. I would like to know if I can make a single link a certain color, such as having a red link, a blue link, and a green link, all on the same page?


  • edited January 2016
    Unfortunately the colour change macros (such as (color: red) or (css: "color: red")) don't work on links. So while it is possible, it is a little clunky.
    First you need to surround each link with a span which has a class attribute to identify it. For your red links you might use
    <span class="red">[[red link->passage]]</span>

    Then in the story stylesheet enter something like this
    .red tw-link {color: red}
    .green tw-link {color: green}
    .blue tw-link {color: blue}

    edit: There is an alternative method which is simpler which is explained by greyelf in this thread:

    add the following code to your stylesheet
    tw-hook[style*="color"] tw-expression > tw-link {
    	color: inherit;

    and then you can use the standard (color:) macro to change the colour of any links.
  • Thank you!
Sign In or Register to comment.