How to align the image in Markdown?

Prev Next

Plans supporting customizing text in the markdown editor

Professional
Business
Enterprise






By default, images are aligned to the left. Markdown doesn't have a built-in way to customize image alignment. You can use the HTML tags provided in this article as a workaround to achieve this effect.

Solution

  1. Go to the desired article in the Knowledge base portal.

  2. Paste the below code in the desired location in the editor where you want the image to appear.

<p style="text-align: center"><img src="https://files.document360.io/filename/folder/subfolder/imagename.png"></p>
  1. The above code is for center alignment. If you want to keep the alignment as left or right, replace the term 'center' in the code with 'left' or 'right' as per your requirement.
  • Right → "text-align: right"
  • Left → "text-align: left"
  1. Replace the URL 'https://files.document360.io/filename/folder/subfolder/imagename.png' with your desired image URL.

Where can I find the URL of an image in Drive?

1_Screenshot-Updated_align_the_image_in Markdown_drive_screenshot

  1. Go to Drive and navigate to the folder in which the desired image is available.
  2. Click the desired image (or) click ••• (next to the desired image name) > View details.
  3. File details panel appears on the right, and you can find the image URL below the Size information.
  4. Click the Copy icon, and the image URL would be copied.

Outcome

Left alignment

Center alignment

Right alignment


Can I add a button, logo, or a clipart and align it in Markdown?

Yes, as long as it is an allowed image file type, you can align it in the Markdown editor.