Center Embedded youtube videos

Is there a way to center embedded youtube videos in a file?
I have embbeded the videos using this syntax -


Add this to snippet.css

	display: block;
	max-width: 768px;
	margin-left: auto;
	margin-right: auto;

Great, thanks!

For some reason, the embeds still appear aligned to the left.

If you are using the Minimal theme, update to the latest version. Seems the left aligned issue was fixed with a recent update. A space in front of the ![](...) also fixes it.

Actually I am using the Annupuccin theme. I will try to update it or the space solution .Thanks!

This didnt work for me, Im not using any plugins and using the default theme. Why are my embeds not centering?

I have embedded a test link using both iframes and the ![](link) notation, still no success.


  1. It looks like it centres YouTube videos (embedded using ![](link) notation in Reading Mode only, not in Live Preview Mode, is there any way to centre it in Live Preview Mode too?
  2. It didn’t affect the centering of iframes, how can I centre all iframes using CSS?