Text alignment

https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-yellow.svg BBCodes 28-Mar-2019T12:52:27 phpBB Studio https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-white.svg https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-white.svg

Text alignment

 
Aligning text to a certain side is used quite often, for various reasons.
It allows you to make your text follow a more natural flow for the readers.
It is also possible to create lines with the same width, which is often used in news papers and magazines.

warning

css3 This BBCode uses inline style!

 


 

pencil BBCode usage

[align={CHOICE=center,justify,left,right;preFilter=strtolower}]{TEXT}[/align]

 

html5 HTML replacement

<div style="text-align: {@align};"><xsl:apply-templates/></div>

 

question Help line

Align text: [align=left|right|center|justify]Text[/align]

 

Explanation

CHOICE=center,justify,left,right;preFilter=strtolower
angle-double-right CHOICE: makes it so that the only allowed options are these four options.
angle-double-right preFilter: turns the user entered string to lowercase, so users can also use LEFT, RiGhT, etc…

angle-double-right Options:
left: Aligns text to the left
right: Aligns text to the right
center: Centers the text
justify: Stretches the lines so that each line has equal width

Examples

[align=left]Left aligned[/align]

Left aligned

[align=right]Right aligned[/align]

Right aligned

[align=center]Center aligned[/align]

Center aligned

[align=justify]Justified text[/align]

Justified text with a very long sentence so that you can properly see the spacing between the words, which is how justified content works. All lines, regardless of how many characters are in there (nor their respective width), end at the exact same point: they are all the exact same length. Apart from the lines that do not need breaking, which can not fill the content of a single line to begin with. Like this last line :writing_hand:.