-
I'm wondering if there's a way to have 2 or 3 columns in markdown, for example to put images next to each other? |
Beta Was this translation helpful? Give feedback.
Answered by
nobkd
Jun 25, 2023
Replies: 1 comment
-
Sure. You can create a block component that is styled as grid and use multiple images inside. <!-- some markdown file -->
::cols
![](imglink1)
![](imglink2)
:: <!-- components/content/Cols.ts -->
<template>
<div>
<ContentSlot :use="$slots.default" unwrap="p" />
</div>
</template>
<style scoped>
div {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
:deep(img) {
max-width: 100%;
}
</style> This would be fixed for two columns. The |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
notflip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure. You can create a block component that is styled as grid and use multiple images inside.
E.g.
This would be fixed for two columns.
The
:deep(img)
is there to prevent images from overflowing, 'cause they seem to get the full site width in the default setting... Maybe you don't need this rule (with some style resets)... 🤷