Skip to content

Center image/figure in post #1514

Answered by george-gca
phber asked this question in Q&A
Jun 27, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

You can do something like this when including an image. Using markdown and adding custom classes:

![]({{ "/assets/img/7.jpg" | relative_url }}){:style="margin:auto; display:block;"}

Or if you are using the figure.html code from the repo, currently you can add your own classes to it.

{% include figure.html path="assets/img/9.jpg" class="img-fluid rounded z-depth-1" %}

You could also extend the figure.html to add support for custom styles like you did. I think yours is a good solution.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Perian-Yan
Comment options

@Perian-Yan
Comment options

Answer selected by george-gca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants