---
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: 2026-06-20T06:46:55Z
published: 2026-06-20T06:46:55Z
canonical: "docs.document360.com/how-to-center-align-the-text-in-markdown"
---

> ## 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

In the **Advanced WYSIWYG editor**, use the **Align center** option in the toolbar to centre-align text with a single click. In the **Markdown editor**, all text defaults to left alignment and there is no built-in centering syntax — the workaround is to use inline HTML, which Document360's Markdown editor renders correctly.

---

## When to use custom alignment

Centre and right alignment are best used sparingly for specific presentational purposes, not for body text. Common use cases include:

- **Pull quotes or highlighted statements** — a short centred sentence draws the reader's eye to a key point.
- **Image captions or standalone labels** — centring a caption beneath an image or diagram improves visual pairing.
- **Section dividers or decorative headings** — a centred H2 or H3 can visually separate major sections in longer articles.

Avoid applying centre alignment to paragraphs of body text — it reduces readability and is not recommended for prose.

 NOTE

This technique only works in the **Markdown editor**. In the WYSIWYG editor, use the **Align center** button in the toolbar instead. The inline HTML tags described here have no effect in the WYSIWYG editor.

---

## Quick reference

Use these snippets directly. Replace `Text_content` with your text.

| Element | Centre-aligned | Right-aligned |
| --- | --- | --- |
| Paragraph | `&lt;p style="text-align:center;"&gt;Text_content&lt;/p&gt;` | `&lt;p style="text-align:right;"&gt;Text_content&lt;/p&gt;` |
| H2 heading | `&lt;h2 style="text-align:center;"&gt;Text_content&lt;/h2&gt;` | `&lt;h2 style="text-align:right;"&gt;Text_content&lt;/h2&gt;` |
| H3 heading | `&lt;h3 style="text-align:center;"&gt;Text_content&lt;/h3&gt;` | `&lt;h3 style="text-align:right;"&gt;Text_content&lt;/h3&gt;` |
| H4 heading | `&lt;h4 style="text-align:center;"&gt;Text_content&lt;/h4&gt;` | `&lt;h4 style="text-align:right;"&gt;Text_content&lt;/h4&gt;` |

---

## How to align text in Markdown

The same pattern applies whether you are aligning a paragraph or a heading — only the HTML tag changes.

1. Open the desired article in the Knowledge Base portal.
2. Paste the appropriate snippet from the table above at the location where you want the aligned text to appear.
3. Replace `Text_content` with your desired text.

**Example — centre-aligned paragraph:**

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

**Output:**

Sample text with center alignment

**Example — centre-aligned H3 heading:**

```
<h3 style="text-align:center;">H3 that is center aligned</h3>
```

**Output:**

### H3 that is center aligned

 NOTE

You can apply standard Markdown formatting — bold, italic, and strikethrough — to the entire HTML tag using the usual syntax.

**Example:**

```
***<p style="text-align:center;">Text with basic formatting applied</p>***
```

**Output:**

***Text with basic formatting applied***
