best way and more simple to center an iframe on your webpage is : <p align="center"><iframe src="http://www.google.com/" width=500 height="500"></iframe></p>
<div class="iframe-container"> <iframe src="https://jsfiddle.net/8z9s1t6x/2/"></iframe> </div> <style> .iframe-container { text-align:center; width:100%; } </style>