how to get rid of horizontal scoll-bar in iframe?

  gplatt2000 18:40 07 Mar 2004

hi there! I have made an iframe showing another svaed page, with CSS scroll bars. But when i preview the page with the iframe, there is a horizontal scrollbar, despite the fact that the content is 10px smaller than the iframe, and so should be no need to scroll.

Here is the code for the iframe:

iframe width="375" height="291" scrolling="auto" marginheight="2" marginwidth="2" border="0" frameborder="0" src="Home - Test Content.htm">

And now the code fr the page to be displayed in the frame:

body bgcolor="#000000" topmargin="0" leftmargin="0">

table width="378" border="0" cellpadding="0" cellspacing="0" align="left">
td width="378" height="345" valign="top"> p> font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Welcome
to Filament's website. Use the menu below left and sub-menu below right
to navigate. /font> /p>
p align="center"> font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> img src="front.JPG" width="197" height="197"> /font> /p>
p align="center"> font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">demo
CD 'Five Shots' will be out soon - a href="demo.htm">click here /a> /font> /p> /td>

Any suggestins to get rid of the unwanted horizontal scrollbar?

Thanks a load

  Taran 19:35 07 Mar 2004

Amend the part in your iFrame code that reads:


Change it to this:


Your options for scrolling are "auto", "yes" or "no".

Changing from "auto" to "no" removes the ability to scroll the content so I hope you're right that the iFrame is, in fact, larger than the content it is displaying.

Save the file and test/upload.

Job done.

  gplatt2000 20:31 07 Mar 2004

Oops sorry i meant to say the content isnt bigger horizontally, but it is bigger verttically - I do want the vertical scrollbar, just not the horizontal one.

Thanks again

  Taran 09:39 08 Mar 2004

Go into the source code of the page you are displaying in the iframe.

If there is anything above the first <html> tag, like this for example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http : // www">

delete/remove it and save the page.

Now load up your main frame page and the horizontal scrollbar should have gone.

This doesn't work all the time but it can sometimes be a miracle cure depending on your page code and DTD header.

You might also try putting a 90% width table into the page that will be in your iframe and put that pages content into the table. In theory the table should resize to 90% of the iframe size, but I've not tried this so don't quote me on it.


  gplatt2000 16:37 08 Mar 2004

Thankyou very much once again Taran, it seems you've cured nearly all of my problems! I used your first suggestion, and now all is well. Thanks again

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

8 brilliant character artists speaking at Pictoplasma 2018

iMac Pro release date, UK price & specs

Football : comment regarder la Ligue 1 en direct ?