---
title: "How to center align the text in Markdown"
slug: "how-to-center-align-the-text-in-markdown"
description: "Using the simple HTML code snippet, you can now center- align or right-align any text in paragraphs or heading in the Markdown editor. "
tags: ["Customization"]
updated: 2025-05-13T08:26:20Z
published: 2025-05-13T08:26:20Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.document360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to center align the text in Markdown

Achieving center alignment in your article is simple with the 'Align center' option in the toolbar of the WYSIWYG editor.

In the Markdown editor, all text defaults to **left alignment**. Markdown doesn't have a built-in way to center align the text. You can use the HTML tags provided in this article as a workaround to achieve this effect.

### Center align text in Markdown

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.

```plaintext
<p style="text-align:center;">Text_content</p>
```

1. Replace the 'Text_content' with your desired text.

> **For example:**
> 
> ```plaintext
> <p style="text-align:center;">Sample text with center alignment</p>
> ```

1. The output would be as below

Sample text with center alignment

> [!NOTE]
> NOTE
> 
> You can add the basic text formatting such as bold, italic, and strikethrough using the usual syntax for the entire code.
> 
> > **For example**,
> > 
> > ```plaintext
> > ***<p style="text-align:center;">Text with basic formatting applied</p>***
> > ```
> > 
> > **Output**:
> > 
> > ***Text with basic formatting applied***

If you want the text to be right aligned, use the following code.

```plaintext
<p style="text-align:right;">Text_content</p>
```

---

## Center align Headings in Markdown

You can also center-align Headings in your article by slightly altering the HTML code snippet. Replace the `&lt;p&gt;...&lt;/p&gt;` with `&lt;h2&gt;...&lt;/h2&gt;`, `&lt;h3&gt;...&lt;/h3&gt;`, or `&lt;h4&gt;...&lt;/h4&gt;`.

> **For example**, to center align a H3
> 
> ```plaintext
> <h3 style="text-align:center;">H3 that is center aligned</h3>
> ```
> 
> **Output**:
> 
> ### H3 that is center aligned

> [!NOTE]
> ** NOTE
> 
> Markdown doesn't have a built-in way to center align text. You can use the HTML tags provided in this article as a workaround within Markdown to achieve this effect.

A Document360 editor type that displays formatted output in real time as you type, so what you see while editing matches what readers see on the knowledge base site. The WYSIWYG editor supports standard formatting (bold, italic, headings, lists, tables, images) without requiring knowledge of Markdown or HTML. For advanced formatting including LaTeX, use the Advanced WYSIWYG editor instead.

The platform where project members manage and create content for the knowledge base. It allows users to create categories, articles, and templates; manage files, team accounts, and readers; and configure site settings such as branding, domain, and security.
