Note: An alternative skin, TW4MW (work in progress), is available from the user preferences.

How do I right-justify some text in a tiddler?

TiddlyWiki Community Wiki

Jump to: navigation, search

From a post by Daniel on the mailing list

I'd do it this way.

First, set up a CSS rule to do the justification. Add something like this to your StyleSheet tiddler (find it on tab More => Shadowed):

.justifyright {
 text-align: right;
}

that gives you a css class of justifyright that you can use to make stuff be right-aligned. Make sure you get the dot at the start of ".justifyright".

Now, edit some tiddler and put the stuff you want to justify inside triple-curly-brackets, with the CSS class after the first two. You will need to put the brackets on lines by themselves.

{{justifyright{
This paragraph will be right-aligned.
}}}

If you want full justification, add a CSS rule like this, and then use "justifyfull" inside the triple curlies:

.justifyfull {
   text-align: justify;
}

Note that this won't work if you use the triple curlies inline:

{{justifyright{ DOESN'T WORK: This is not right justified }}}

This is because triple curlies make spans if you use them inline {{{like this}}}, but divs if you use them on lines by themselves.


<< Back to FAQ list

Personal tools