You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now in a note in Obsidian try to center an image with this line:

In Obsidian the result is a centered image, but in the plugin output HTML the image is not centered, it’s still at the left.
Workaround
I’m able to inject the centered image directly in HTML by including this in the note in Obsidian: <img alt="center" src="C:\file_location\IMG_0005.jpeg">
In the plugin output HTML, the image is now correctly centered.
The workaround works, but I think the normal Obsidian syntax should be supported here. And the custom CSS in question is pretty standard?
Also, for reference: if you remove [alt*="center"] from the CSS, so all images should now be centered, still the plugin output does not have it centered.
github-actionsbot
changed the title
[Bug]: CSS for centering of images doesn't work
[Bug] [1.9.0-3b]: CSS for centering of images doesn't work
Jan 17, 2025
What happened?
Problem
Create a custom CSS snippet with this:
Now in a note in Obsidian try to center an image with this line:

In Obsidian the result is a centered image, but in the plugin output HTML the image is not centered, it’s still at the left.
Workaround
I’m able to inject the centered image directly in HTML by including this in the note in Obsidian:
<img alt="center" src="C:\file_location\IMG_0005.jpeg">
In the plugin output HTML, the image is now correctly centered.
The workaround works, but I think the normal Obsidian syntax should be supported here. And the custom CSS in question is pretty standard?
Also, for reference: if you remove
[alt*="center"]
from the CSS, so all images should now be centered, still the plugin output does not have it centered.Reproduction
See above.
Last Working Version
No response
Version
1.9.0-3b
Operating System
Windows
Obsidian Version
Current: v1.7.7, installer: v1.6.3
Which browsers can you reproduce this in?
Chrome, Microsoft Edge
Relevant log output
Additional Info
No response
The text was updated successfully, but these errors were encountered: