Title: Change Iframe size
Last modified: November 21, 2018

---

# Change Iframe size

 *  [astima](https://wordpress.org/support/users/astima/)
 * (@astima)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/)
 * I have to say I’m a I’ve been working on this for a few hours. I was successful
   in embedding an iframe to display our products, but I cannot figure out for the
   life of me why the I-frame is 150 pixels in height. I want the I-frame to be 
   the height of the page that I embedded. I am trying to figure out what is setting
   the height to 150.I figured out several different solutions to fixing this issue
   using CSS, but I don’t like any of them. But my biggest issue is figuring out
   why it is 150 pixels to begin with.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchange-iframe-size-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904238)
 * How are you adding the ifames from vtinfo?
 *  Thread Starter [astima](https://wordpress.org/support/users/astima/)
 * (@astima)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904250)
 * Our parent company provided us with script to enter into our header (which took
   me a while to figure out how to do). Could one of the scripts be what is causing
   it to be 150 pixels.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904255)
 * It certainly could be. Talk to the developer(s) of that script.
 *  Thread Starter [astima](https://wordpress.org/support/users/astima/)
 * (@astima)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904282)
 * Below is the only code I saw that refers to height in the script. I don’t fully
   understand it.
 *     ```
        currentViewportWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
             currentViewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
             document.getElementById('brand-builder-iframe').contentWindow.postMessage({
               width: currentViewportWidth,
               height: currentViewportHeight
             }, '*');
       ```
   
    -  This reply was modified 7 years, 5 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904352)
 * just for fun, try changing it to “height: 100%”.
 *  Thread Starter [astima](https://wordpress.org/support/users/astima/)
 * (@astima)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904393)
 * Where exactly should I change the height?
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904399)
 * in the script.
 *  Thread Starter [astima](https://wordpress.org/support/users/astima/)
 * (@astima)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904423)
 * So I would change the code to this:
 *     ```
       currentViewportWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
             currentViewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
             document.getElementById('brand-builder-iframe').contentWindow.postMessage({
               width: currentViewportWidth,
               height: 100%
             }, 
       ```
   
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904437)
 * Yeah, try it and see what happens. If it breaks stuff put it back to what it 
   was and talk to the developers of the script.
 *  Thread Starter [astima](https://wordpress.org/support/users/astima/)
 * (@astima)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904597)
 * Unfortunately, it did not work. But I appreciate all your help

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Change Iframe size’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [iframe](https://wordpress.org/support/topic-tag/iframe/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 2 participants
 * Last reply from: [astima](https://wordpress.org/support/users/astima/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/change-iframe-size-2/#post-10904597)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
