Skip to content

Add a way in the template to center images? #49

@bparks13

Description

@bparks13

Is there any way to modify the template or to add some CSS that will center images? Using the default format of ![Title](../link/to/image.png) attempts to stretch the image from end to end, which makes it appear centered, but if we want to set a particular width (i.e. ,![Title](../link/to/image.png){width=600px}) then it will always be a left-aligned image.

It is possible cheat a little bit and directly inject HTML into the markdown file, but this goes against the philosophy of Markdown. Adding HTML like this works

<p align="center">
  <img src="../link/to/image.png">
</p>

But this doesn't look very clean in the Markdown file, and also might not be properly rendered depending on what is serving the page.

My preferred method would be to add an align="center" parameter after the pixel width if possible (i.e., ![Title](../link/to/image.png){width=600px,align="center"}), I think this keeps it as clean as possible while allowing for some customizability. However, I genuinely do not know if this is possible on the backend, hence the Question label.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions