On entry save/update, centered text returns to left in rich text field

Melody: 19 May 2022

How am I to center text with in the rich text field type? It centers while I'm editing, then returns to left align on save (and on output). I feel like I'm missing something obvious here...

Ryan: 19 May 2022

When you create a Rich Text field, there is an option for Clean up HTML which is checked by default. The description underneath the setting reads:

Removes spans, empty tags, and most style attributes on save.

When aligning text in Redactor, inline styling is added, which would be stripped away on save if the Clean up HTML option is checked.

You'll just need to uncheck this option in your field settings if you want inline styles to be saved.