Well of Stars

Tips and Troubleshooting: Iframes

Using php includes on all your pages isn't compatible with an iframes layout - you'll find that the whole layout appears in your iframe, instead of just the page content. However, it's possible to achieve the look of an iframe using a scrolling div (see for example, this site. Code the layout exactly as you would for a regular div-based layout. For the div containing your content, set the width and height you want for the "frame" using css, and also include the css style overflow: auto.

For example:

... all your preceding header content
<div id="content">
Your page content here
</div>
... following footer content

and in the css file:

#content {
position: absolute;
top: 65px;
left: 339px;
width: 373px;
height: 264px;
overflow: auto;
}

Back to contents