How to Center Align an iframe Embed in WordPress

How to Center Align an iframe embed in WordPress


iframes are an HTML element that allows you to display another web page within the current page. The iframe element is usually placed in the center of a page. But WordPress doesn’t accept the usual method of aligning an iframe and using: align="middle" won’t work.
The easiest workaround I found is to wrap the iframe code in center tags. For example:

Code block showing iframe wrapped in center tags

Wrapping the iframe in a div block also works:

iframe code wrapped in div tags

Journal →