0 votes
by (190 points)
I’m wanting to add a white background to just a single passage. I don’t want to use any white images off the internet. Is this possible?

I’m new to twine.

Thanks :)

2 Answers

0 votes
by (320 points)

You could use this code in a "header"-tagged passage:

{
(print: "<script>$('html').removeClass(\)</script>")
(if: (passage:)'s tags's length > 0)[
(print: "<script>$('html').addClass('" + (passage:)'s tags.join(' ') + "'\)</script>")
]
}

Then, in the story stylesheet you can adress passages via their tags like:

html.tagName{
background-color: white;}

 

+2 votes
by (23.6k points)

Add something like this to your Stylesheet:

tw-story[tags="white"] {
background-color: white;
}

Now every passage you tag "white" will have a white background.

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.
...