Iframes can be tricky. And they will eventually be phased out. However,if you don't mind sticking to a DOCTYPE like:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
They will be supported for a very long time.
You should only need this DOCTYPE on your top page, the one with the iframe tag.
Now, the reason they are tricky is that support varies among browsers. However, with most browsers, if the body of the external page is set in its stylesheet:
Code:
body {
margin:0;
padding:0;
}
and the iframe tag itself is like:
HTML Code:
<iframe src="whatever.htm" frameborder="0" width="200" height="300"></iframe>
(width and height at your discretion, they may both be set as 100% if there is already a container for the iframe on the top page of the desired dimensions)
Once you have all that, the contents of the external page(s) (whatever.htm in this example) may be left aligned (the default if alignment is not specified) or centered aligned. Either way, the external page will line up with the iframe. If the iframe fills its container, or nearly so, and the external page doesn't exceed the iframe's dimensions, it will look virtually seamless.
Bookmarks