Getting iframes to appear centered for WordPress pages/posts

I recently set up a few iframes and they were stubbornly left aligned despite all the other content being center aligned. Here’s how I was able to fix the issue.

  1. Go to Appearance –> Customize –> Additional CSS (/wp-admin/customize.php)
  2. Add this value to your custom CSS

iframe {
display: block;
margin: 0 auto;
}

3. Hit publish and you should be good!

Leave a Reply

Your email address will not be published. Required fields are marked *