Skip to content

How to place a image in center? #430

Answered by yhatt
Serenade600 asked this question in Q&A
Discussion options

You must be logged in to vote
![](./img/maze.png)

This Markdown renders a following HTML:

<p>
  <img src="./img/maze.png" />
</p>

<p> tag (paragraph) is aligning its contents to left (text-align: left). Thus, using a following style can align contents into center.

<style scoped>
p { text-align: center; }
</style>

See also https://marp.app/blog/the-story-of-marp-next#image for more flexible way. It can define center keyword for the image. (WARNING: This way is abusing an alternative text of the image)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@yhatt
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Serenade600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants