Location: PHPKode > projects > Modular Site Manager > htdocs/tutorials/PHP-1.php
So, you want a cross-browser compatible i-frame? You came to the right section :p <br />
<br />
ok, this is gonna have some PHP in it, so you'll want a tiny understanding of both CSS and PHP. <br />
I'll explain it of course :p <br />

ok, first we put the html for our faux iframe. <br />

<div class="code"><strong>CODE:</strong><br /><hr />
<?
xhtml_highlight('<style type="text/css">
	.iframe {
		overflow:auto;
		height:75px;
		width:100px;
	}
</style>
<div class="iframe"></div>');
?></div>
<br />
<br />
ok first, i'll explain this. <br />
<br />
<div class="code"><strong>CODE:</strong><br /><hr />
<?
xhtml_highlight('<style type="text/css">
	.iframe {
		overflow:auto;
		height:75px;
		width:100px;
	}
</style>'); 
?></div>
<br />
<br />
<br />
of course, we have to tell the browser what this code is for (the <strong>&lt;style&gt;</strong> tags) but thats not what i need to explain :p<br /> 
<br />
<strong>overflow:auto;</strong> <br />
<br />
"now what is that?" your probably asking.<br />
<br />
it's simple. its telling the browser that when it gets 75px long, and/or 100px wide, to make a scroll bar! You can see it in action just by looking at my floodbox :)<br />
<br />
and of course we have the <b>&lt;div&gt;</b> tags, and we assign the "iframe" class to them, so the browser knows where to put the scroll bar. now all you have to do is throw in the php <br />
<br />
<div class="code"><strong>PHP:</strong><br /><hr />
<?
xhtml_highlight('<style type="text/css">
	.iframe {
		overflow:auto;
		height:75px;
		width:100px;
	}
</style>
<div class="iframe"><?php include "test.htm"; ?></div>'); 
?></div>
<br />
<br />
bada-bing, bada-boom, you've got yourself a fake iframe! <br />
<br />
you can of course add a border by adding <strong>border-style:someborderstyle;</strong> in the iframe class.
Return current item: Modular Site Manager