Aligning admonitions horizontally with a css flexbox (all in markdown document) #2190
fralau
started this conversation in
Show and tell
Replies: 1 comment
-
Note that this is not restricted to admonitions. Basically, it will work with any block elements (add <section markdown="1" style="display: flex;">
<div class="my-block" markdown="1">
## Is your company, department or team..."
* Waiting for solutions ?
</div>
<div class="my-block" markdown="1">
## Tip "How to be more effective "
* You could do this and that
</div>
</section> From there, adding a little css dressing to the box divs (margin, border, padding, font size, background) would be easy. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just in case, I found this interesting usage. It's too early to say whether it will be actually useful, but it's worth mentioning.
Essentially, it consists of placing a number of admonition bits, between in an HTML
<section>
, with adisplay:flex
style (flexbox). This will align the elements side-by-side, no css fiddling required, except this declaration.This requires, of course, forcing MkDocs to interpret the markdown inside the
<section>
tag. For that there is themd_in_html
markdown extension (which is part of the standard extensions). To invoke interpretation of the markdown, it is sufficient to add the attributemarkdown="1"
to the<section>
tag.And it works !
Beta Was this translation helpful? Give feedback.
All reactions