---
title: "Making an iframe take vertical space"  
description: "Making an iframe take vertical space"  
author: "Pravesh Singh"  
published: 2013-02-13  
updated: 2013-02-13  
canonical: https://www.mindstick.com/forum/599/making-an-iframe-take-vertical-space  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# Making an iframe take vertical space

Hi!

I would like to have an [iframe](https://www.mindstick.com/forum/1712/how-to-fit-ifrme-in-mobile-browser) take as much [vertical](https://www.mindstick.com/forum/12951/how-to-fix-bootstrap-tab-vertical-with-text) [space](https://www.mindstick.com/articles/12954/do-your-electrical-repair-in-your-own-space) as it needs to display its [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand) and not display a scrollbar. Is it at all possible ?

Are there any workarounds?

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by AVADHESH PATEL

Hi Pravesh!

This should set the IFRAME height to its content's height:

```
<script type="text/javascript">
       var height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
               document.getElementById('the_iframe').height = the_height;
</script>
```

\
You may want to add scrolling="no" to your IFRAME to turn off the scrollbars.


---

Original Source: https://www.mindstick.com/forum/599/making-an-iframe-take-vertical-space

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
