Howdy, Stranger!

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

[Sugarcube] Text Align in css just straight up doesn't work

Ok so I have been playing around with css and while I was testing some stuff I found out text-align does absolutely nothing. I tried making a simple custom css
#testingstyle
{
	color:red;
	text-align:center;
}
just made the text red, still left aligned. Then I just straight up put
@text-align:center;this should be in the center@@
and again it did nothing.

I looked it up and all I saw was setting the alignment for all passages which is not what I want. I want to be able to change the alignment on the fly.

Comments

  • edited May 2016
    note: You are using an ID based CSS selector, changing it to a class based one would allow you to use that style rule more than once within the same passage.

    If you read the Custom Styles section of the SUgarCube 2 documentation may notice that the four examples are sub-divided into those related to inline and those to block.

    You need to use the block related format if you want to use text-align because it generates a HTML div element which by default supports text alignment.
    @
    

    The inline related ones generate a HTML span element which by default does not support text alignment.
  • edited May 2016
    I see, thanks. I don't know much about html to be honest. I didn't think I would need to coming into twine.

    Also I accidentally posted this as a discussion it seems so I can't mark it as answered :(
Sign In or Register to comment.