0 votes
asked by (530 points)

In converting my game from Harlowe to Sugarcube, I'm having difficulty centering specific lines of text.

Harlowe had this markup which made things easy, but I can't find a clear/simple enough answer for Sugarcube. I tried creating this custom style in the stylesheet:

.center {
	text-align: center;
}

But applying it like other styles seems ineffective:

@@.center;center this text@@

So how can I center align text?

1 Answer

0 votes
answered by (121k points)
selected by
 
Best answer

The variation @@ styling you are using creates a span element, and they are an inline type element so they cant' be centered.

Use the multi-line variation of @@ like so.

@@.center;
center this text
@@

... which creates a div element (which is a block type) which can be centered.

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