To align an image to the bottom in Obsidian using CSS snippets, you can create a custom CSS snippet that targets images with a specific alt text identifier. Since you prefer using CSS snippets, you can follow a similar approach to the one described in the Obsidian Forum for aligning an image to the right[1].
Here’s a step-by-step guide to create a CSS snippet to align an image to the bottom:
- Create a new CSS snippet file in Obsidian’s snippet folder.
- Add the following CSS code to the snippet file:
/* Align image to the bottom */
img[alt*="bottom"] {
display: block;
margin-top: auto;
margin-bottom: 0;
vertical-align: bottom;
}- Save the snippet file with a
.cssextension. - Enable the snippet in Obsidian’s Appearance settings under CSS snippets.
Now, when you want to align an image to the bottom in your note, you can include “bottom” in the alt text of the image link like this:
The CSS snippet will target this image due to the “bottom” keyword in the alt text and apply the bottom alignment styles to it.
Please note that the effectiveness of this method depends on the specific version of Obsidian you are using and whether it supports the necessary CSS properties. Additionally, the exact CSS might need to be adjusted based on your theme and other active CSS snippets.
Citations: [1] https://forum.obsidian.md/t/align-specific-img-to-the-right/56477 [2] https://www.reddit.com/r/ObsidianMD/comments/v1fs0f/centering_images_in_reading_mode/ [3] https://youtube.com/watch?v=pDl418_Yj4w [4] https://stackoverflow.com/questions/43940167/html-image-and-text-align-top-and-bottom [5] https://www.reddit.com/r/ObsidianMD/comments/17azuog/obsidian_image_position/?rdt=61197 [6] https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037 [7] https://github.com/SlRvb/Obsidian—ITS-Theme/blob/main/Guide/Image-Positions.md [8] https://youtube.com/watch?v=VRoBNWvw8sU [9] https://forums.obsidianportal.com/discussion/5492/aligning-images-in-the-wiki [10] https://forum.obsidian.md/t/indenting-pictures/32747