General Community > HTML/CSS

HTML inline Frame tag (<iframe>)

(1/1)

Oldiesmann:
I am working on my new site, and am using an inline frame to display the menu so I don't have to include the code for the menu on every single page. The problem I'm having is, the iframe has to have a height of "84" or I get a vertical scrollbar in the frame window. This is really annoying because the only thing in that frame is a table, and the table's height is not anywhere near 84 pixels. Here's the code:

iframe tag:

--- Code: ---<iframe width="100%" frameborder="0" src="menubar.html" align="center"></iframe>
--- End code ---

menubar.html:

--- Code: ---<table align="center" border="2" bordercolor="#6699CC" style="shadow-color:#FFFFFF"><tr align="center" valign="middle"><td align="center" width="10%"><a href="http://www.oldiesmann.us" target=_parent>Home</a></td>
<td align="center" width="9%"><a href="news.php" target=_parent>News</a></td>
<td align="center" width="19%"><a href="discography.php" target=_parent>Discography</a></td>
<td align="center" width="10%"><a href="http://forum.oldiesmann.us" target=_parent>Forum</a></td>
<td align="center" width="13%"><a href="webring.php" target=_parent>Webring</a></td>
<td align="center" width="16%"><a href="/xeobook" target=_parent>Guestbook</a></td>
<td align="center" width="15%"><a href="aboutme.php">About Me</a></td>
<td align="center" width="9%"><a href="links.php" target=_parent>Links</a></td></tr></table>
--- End code ---

The only other code in the menubar page is a small CSS script that changes the style of the table cell when you point to it, but this shouldn't cause all the extra space in the iframe. I'm trying to make the table vertically centered within the frame and make the frame height about the same as that of the table (note that there is no pre-defined table height). How can I do this? Is there a way to do this in php without using HTML?

link: http://members.lycos.co.uk/oldiesmann/mainpage.php (test site - not the final location).

Spaceman-Spiff:
you can use this css to disable scrollbar:
style="overflow: hidden;"
or make your site in php and use php include

Seph|roth:
Use <iframe> like this:


--- Code: ---<iframe src="http://www.site.com/page.ext" width="n" height="n" frameborder="n" scrolling="[yes/no/auto]" name="whatever"></iframe>
--- End code ---
where n = any number, and scrolling = auto means the browser will auto detect whether scrollbars are needed to display this entire src.

Oldiesmann:
Ok. That sounds good. I am using php to make my site, so I think I will just combine the menubar and the CSS files into one and call it header.php.

Navigation

[0] Message Index

Go to full version