How to align the image in Markdown?
  • 10 Aug 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How to align the image in Markdown?

  • Dark
    Light
  • PDF

By default, images are aligned to the left. You would want to change the alignment of certain images in your articles. You can easily perform this action in the WYSIWYG editor with the 'Align' options in the toolbar. However, there is no option to align the image in Markdown. Follow the below workaround to keep the image in the desired alignment in Markdown.

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?

10_Screenshot-Image_link_copy

a. Go to Drive and navigate to the folder in which the desired image is available
b. Click the desired image (or) Click ••• (next to the desired image name) → View details
c. File details blade appears on the right, and you can find the image URL below the Size information
d. Click the Copy icon, and the image URL would be copied

Outcome

Left alignment

Center alignment

Right alignment


Was this article helpful?