IFRAME Destroying Bottom of page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm trying to setup a small site with a few pages for a friend who runs
a karate club.  To keep things simple the idea is to have a number of
very simple text pages he can open in notepad and update as he wishes.
These simple pages will then be displayed within an IFRAME when a link
button is clicked by changing the IFRAME's SRC attribute with

To control layout I'm using a table.  However when I add the IFRAME to
the table it completely messes things up below.

This link shows what the site should look like, I've commented out the
IFRAME to do this (require IE until I've found an alternative to

And this is what happens when the IFRAME is turned back on:

Could anyone tell me what the IFRAME is doing to mess things up, as I
expected it to simply fill its table cell and nothing else.  And after
hours of changing things I cant seem to fix it.



Re: IFRAME Destroying Bottom of page

Quoted text here. Click to load it

At the moment you have them change when the link is moused over.

Quoted text here. Click to load it

And when JavaScript isn't enabled? Why not just make them ordinary
links? Less work for you, less chance of something going wrong, works
for all users.

Quoted text here. Click to load it

Oh dear.

Huh? document.getElementById(id) is the standards compliant
alternative to the IE document.all.id

What antique browser are you using that doesn't support getElementById
(assuming JavaScript is enabled of course)?

The reason why your code might not work in some browsers is that you
say document.getElementById('frame1').src='about.html' but your iframe
doesn't have an id. It's only IE's (and Opera's it seems) generous
error correction that maps the iframe's name attribute to the missing

Quoted text here. Click to load it

Six validation errors -

Quoted text here. Click to load it

Ditto -

Quoted text here. Click to load it

Iframe is not an empty element. It needs (a) some content for when the
iframe is not displayed and (b) a closing tag.

<iframe name=frame1 marginwidth=1 marginheight=1 src="home.html"
frameborder=0 width="100%" scrolling=no>
    <!-- BODY END ---------------------------------------------->
    <td height="10%" align=center valign=middle>footer</td>


Ignoring the malformed comment this the same as saying

<iframe name=frame1 marginwidth=1 marginheight=1 src="home.html"
frameborder=0 width="100%" scrolling=no>
<!-- here's some content for when the iframe can not be displayed -->
  <td height="10%" align=center valign=middle>footer</td>
<!-- end of fallback content -->

Which is exactly what the browsers display.

"My theories appal you, my heresies outrage you,
 I never answer letters and you don't like my tie."  - The Doctor

Re: IFRAME Destroying Bottom of page

Hi Steve,

Thanks for taking the time to reply, your comments were very helpful!

As you've probably guessed I'm not a professional web developer.  I'm
attempting to setup this site to help out a mate, and hopefully learn
something.  I have an understanding of how HTML works, but I lack
knowledge and experience.

I think I'm probably going to take your advice and ditch the javascript
and replace it with proper links.  The javascript thing was an
experiment, and I think the idea was basically sound.  I was attempting
to use one page to display whatever content was requested.  This should
mean that all the pages are guaranteed to look the same as they would
all be using the same layout.  If I use discreet pages for each link,
I'll have to change them all if I decide to make a change to any one of
them.  Thats more work isn't it?

It appears you dont approve of using a table for layout.  I keep
reading the CSS is the proper tool for setting out page layouts.  But I
just cant picture how it works.  Formatting stuff with CSS makes bags
of sense, but I've yet to see the light on using it for putting things
where I want them.  I'm going to have to take some time to go through
it and get my head around it.  Tables are just easier to understand and



Re: IFRAME Destroying Bottom of page

colin.steadman@gmail.com wrote:
Quoted text here. Click to load it

What would be far superior then the iframe, javascript and all is if you
server supports PHP, and many do. Just do the page in PHP and have it
inset the text file with an include...


<head><title>karate club news</title></head>
<h1>What's happening at the karate club</h1>
<p>Rest of page</p>

then all you buddy has to do is edit the 'news.txt', no iframes,
javascript, or html experience on you buddy's part need.

Take care,

Site Timeline