Follow @BPSPro

WordPress iFrame – Change Height and Width in a WordPress iFrame

1 Comment RSS Site Feed Author: AITpro Admin
Published: May 15, 2010
Updated: December 20, 2010

The original question was regarding changing the height and width settings of an iFrame in WordPress. There was not enough specific information in the original question to determine exactly what the specific WordPress iFrame issue was.

Not exactly sure what you mean by 100% height. I assume that you mean that you either want the iFrame to be aligned to the top of your website page or you want the iFrame within a page to be aligned to the top of the page content area. It does not sound like you want to know how to add height=”100%”, but if that is what you were looking for then that is how you would do it.  If you have created the iFrame code yourself and not used a widget then you would add the dimensions like the example below (beginning brace < and ending brace />have been removed – otherwise you would see the actual iframe displayed)

iframe id="aitpro" src="" width="850" height="1580" frameborder="0">iframe

By the way you phrased your question it appears that you are most likely working with an iFrame widget within a page on your WordPress site. Whichever WP iFrame widget you are using will allow you to set the height and width the same as if you were creating a custom iFrame template yourself outside of WordPress (creating it on your local computer with Dreamweaver or another program or editor). You have a code view button in WP that will let you edit the code to add the height.

I have a hunch though that what you really want to do is remove any top margins or top padding so that your iFrame is flush with the top of your website page. If my hunch is right then you will need to edit your theme’s style.css file and adjust the margins and padding in the stylesheet.

I’ll check back on this question and if you add more specific info i can give you the exact answer you are looking for. Good luck! 😉

Skip to toolbar