0 votes
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
by (159k 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.

...