Skip to content

Manipulating Positions of Multiple Images in Slides + Recurring Image #455

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

You must be logged in to vote

As a basic thing, Markdown will create implicit pararaphs <p> to every separated lines. So styling just a p may break other contents as you've tried.

Changing p selector to p:has(img) may work, but my best practice is using CSS background-image for the slide container <section>.

Using background images is also important for preserving text semantics in Markdown, and making better documents that both of Markdown and its output are in consideration of accessibility.

---
_class: title
---

<!-- Global style -->
<style>
section {
  /* Note: Relative path is resolved from a directory that Markdown/HTML is located, not CSS */
  background: url('./meanvecAB.png') no-repeat right 20px top 20px / 80

Replies: 1 comment 1 reply

Comment options

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

Answer selected by yhatt
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