Skip to content

figure position in the right-top #386

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

You must be logged in to vote

There are several ways. If you want a one-shot placing of the image, defining simple image style in your slide like following, to put an image with absolute positioning.

<style>
img[alt~="top-right"] {
  position: absolute;
  top: 30px;
  right: 30px;
}
</style>

# Your slide

![top-right](https://marp.app/assets/marp.svg)

top and right CSS declarations are meaning position of the image from edge. You can tweak 30px if necessary.

Warning This example is abusing alt attribute of <img> element, for making easy to target style to the image via Markdown syntax ![top-right](). If your slide output must consider users who using screen reader, recommend to avoid element narrowing by abused alt

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kongdd
Comment options

You must be logged in to vote
0 replies
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