Hi all,
I have a page with three columns – 25%, 50%, 25%.
Column 1 contains a menu of hyperlinks. When clicked the file opens in an iframe in Column 2. (Column 3 is left blank – for page formatting only.)
My problem is that I can’t control the height of the iframe. If I specify a height which is too small then I get a vertical scrollbar on that column. But there is also a vertical scrollbar on the whole page, and in order to see the entire content of my file in the iframe I need to use both scrollbars.
I can overcome this by specifying a larger value for the iframe height. In this case the content fits comfortably into the iframe and there is no need for a scrollbar on that column – the main page scrollbar is all I need to use to see the complete document. And this is the situation I want, i.e. only one scrollbar.
But the problem with this is my menu links lead to documents of different sizes. If I specify a height value for the iframe which accommodates the largest file, I then have a lot of blank space at the end of the smaller files. In other words my scrollbar takes me way past the end of the file contents.
Is there a way for me to allow the iframe to adjust its height to suit the file contents so that I don’t have the blank space at the bottom and so that I don’t have a vertical scrollbar on the iframe?
The relevant bits of code are:
To create my three columns
To create the iframe
To create a fixed menu on the page which is unaffected by scrolling the main content.
HTML
All files are in the same folder/directory.
Thanks in advance for any assistance.
Robert
I have a page with three columns – 25%, 50%, 25%.
Column 1 contains a menu of hyperlinks. When clicked the file opens in an iframe in Column 2. (Column 3 is left blank – for page formatting only.)
My problem is that I can’t control the height of the iframe. If I specify a height which is too small then I get a vertical scrollbar on that column. But there is also a vertical scrollbar on the whole page, and in order to see the entire content of my file in the iframe I need to use both scrollbars.
I can overcome this by specifying a larger value for the iframe height. In this case the content fits comfortably into the iframe and there is no need for a scrollbar on that column – the main page scrollbar is all I need to use to see the complete document. And this is the situation I want, i.e. only one scrollbar.
But the problem with this is my menu links lead to documents of different sizes. If I specify a height value for the iframe which accommodates the largest file, I then have a lot of blank space at the end of the smaller files. In other words my scrollbar takes me way past the end of the file contents.
Is there a way for me to allow the iframe to adjust its height to suit the file contents so that I don’t have the blank space at the bottom and so that I don’t have a vertical scrollbar on the iframe?
The relevant bits of code are:
To create my three columns
CSS:
.column {
float: left;
}
.col1 {
width:25%; background-color:wheat;
}
.col2 {
width: 50%; background-color:wheat; padding-left:20px; padding-right:20px; height:100%; overflow:visible;
}
.col3 {
width:25%; background-color:wheat;
}
To create the iframe
CSS:
iframe {
width:100%;
border:none:
}
To create a fixed menu on the page which is unaffected by scrolling the main content.
CSS:
#menuspace {
position:fixed;
top:150px;
left:0px;
padding-left:50px;
padding-right:40px;
}
HTML
HTML:
<div class="column col1">
</div>
<div class="column col2">
<iframe src=" Story Introduction.html" name="myFrame" width="100%" style="border:none" style="overflow:visible" style="scrolling:no" height="15000px" padding-right="100px" ></iframe>
</div>
<div class="column col3">
</div>
<div id="menuspace">
<h2 align="center">The Four Stories</h2>
<p></p>
<p><a href="Story 1.html" target="myFrame">First story</a></p>
<p></p>
<p><a href="Story 2.html" target="myFrame">Second story</a></p>
<p></p>
<p><a href="Story 3.html" target="myFrame">Third story</a></p>
<p></p>
<p><a href="Story 4.html" target="myFrame">Fourth story</a></p>
</div>
All files are in the same folder/directory.
Thanks in advance for any assistance.
Robert