Arima Mary's Blog

Code Snippets for Images

Note: I was told using <figure> and <figcaption> tags may be best practices for accessibility. I'll update this post according when I change my habits.

Honestly I don't know why I never wrote a snippet for images when on Bearblog and Dreamwidth I always code them by hand. These snippets automatically center the image.

I prefer using HTML over Markdown to share images because it gives me more granular control and formats the image ID nicely with the figcaption tag.

Regular image code

Add Images Using Markdown

Tip: Instead of 100% for the width you can play around with other sizes if the image looks too big. I recommend 300px or 500px.

Last updated: 1 week, 2 days ago

Comment and share this post via: email, Dreamwidth, Pillowfort (RIP).

#2026 #coding #reference