Howdy, Stranger!

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

Stupid question - Text color change on Sugarcube?

I've been looking around the internet, but I can't seem to find anything on how to get my story to show just one sentence as red, whereas everything else stays the way it is. I tried putting in the CSS into the "edit story stylesheet" but it didn't work when I tested the game.

If someone could tell me clearly how to make one sentence red and everything else stays the same on sugarcube, I'd really appreciate it.

Comments

  • One sentence as in exactly one sentence or one sentence every once and a while?

    For the former, you could either use the custom styles markup or a <span> element with the appropriate CSS style. For example:
    @
    
    → Using a <span> element
    <span style="color:red">I'm red text.</span>
    

    For the latter, you're probably better off making a CSS class out of it and, again, either using the custom styles markup or a <span> element with the class. For example, the CSS (goes in the Story Stylesheet):
    .reddish {
    	color: red;
    }
    
    And making use of it:
    @
    
    → Using a <span> element
    <span class="reddish">I'm red text.</span>
    
  • Figured it out myself. You have to add the tag "stylesheet" to the lexia, and then treat that like an HTML file. From there the code works perfectly.
  • edited May 2015
    I just use it the way TheMadExile writes.

    I go:

    <span class="redtext">This text is red.</span>

    And in CSS:

    .redtext {
    color: #800000;
    }
  • The stylesheet tag does absolutely nothing in Twine 2, so I can only assume that you're using Twine 1, and thus this thread is tagged improperly.
  • The stylesheet tag does absolutely nothing in Twine 2, so I can only assume that you're using Twine 1, and thus this thread is tagged improperly.

    I'm using Twine 2.0.4. It's far more likely I just have no idea what I'm talking about.
  • Heh. I suppose that's a possibility too.
Sign In or Register to comment.