How to align text/any html element to center/right?

I know that i could use

<div align="right">

to get


But it seems that this is deprecated and css should be used instead:

  • w3schools:

  • mdn:

Because of this is there any other way to right align? (think that chrome folks may come anytime and remove this old feature to get 0.0069% of performance on mobile or something ( yes ).

In Discourse, that’s the best way to center/right align.

Never trust w3school.

1 Like

But it’s not only w3school:

If you must <div data-theme-align="xyz"> is already whitelisted, you can use that with a theme component, exercise left to the reader :slight_smile:


Sorry if i’m a whiny but that is still not enough: think that a forum’s users also use other discourse forums which don’t have my “cheesecake”. If discourse would have this baked-in (my kind of cake) then everyone would do the same and there would be a single source of truth: yours.

Well that is why you can just use align and ignore the obsolete for now, if this becomes a real problem we can introduce class='align-left' or whatever.

Also note that all of this is hacky regardless cause there is no proper markdown for this … so you can take this up at: