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

...