How to Align Images in Obsidian.md

A Micro-Post

Today, I wrestled with some CSS snippets for my open-access notebook. The snippet is a simple code to align images rendered in the OAN front matter, i.e., the webpage. First, I needed to centre an image on the Navigating the OAN page. I ignorantly thought this would be simple. HA. The code was simple; learning how to do it was not easy. It took a bit of Google and YouTube searching to find the code I needed. I used different variations, some using HTML, while others were plain CSS. Each had convoluted explanations that made using the code more complicated than needed.

The solution I used came from a YT channel called Obsidian Tutorial, which I’ve embedded in the video below. The creator explains the steps simply and clearly with easy-to-use CSS. This is great for code dummies like myself. Please watch the video if you need a quick fix for image alignment in your Obsidian vault. Also, subscribe to Obsidian Tutorial to support the channel. Here is the code I used.

The code is in plain text and will need to be saved as a .css extension. The video explains this in simple to understand language.

div[src$="#right"] { text-align:right; } div[src$="#left"] { text-align:left; } div[src$="#center"] { text-align:center; }
Previous
Previous

Obsidian.md for Scholars Series

Next
Next

Logistics of an Open Access Notebook.