How to center align the text in Markdown?
  • 03 Aug 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How to center align the text in Markdown?

  • Dark
    Light
  • PDF

You would want to center-align certain content in your articles. You can easily perform this action in the WYSIWYG editor with the 'Align center' option in the toolbar. However, there is no option to center align the text in Markdown. Follow the below workaround to center align the text in Markdown.

Solution

  1. Go to the desired article in the Knowledge base portal
  2. Paste the below code in the desired location where you want the text to appear
    <p style="text-align: center;">Text_content</p>
  3. Replace the 'Text_content' with your desired text
  4. The output would be as below

    Sample text of center alignment made bold

If you want to make that text to be in bold, use the below code
**<p style="text-align: center;">Text_content</p>**

Right align

If you want to make that text to be in the right alignment, use the below code
<p style="text-align: right;">Text_content</p>


Was this article helpful?