Welcome to WebmasterWorld Guest from 54.145.58.37

Forum Moderators: incrediBILL

Message Too Old, No Replies

iframe Horizontal Scroll Bar Hassle

Old problem, any new ideas?

     
11:29 pm on Jun 27, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 25, 2006
posts:51
votes: 0


I am having some iframe hassles that are driving me to drink. I know this is a problem which has been discussed here before, but here I go again:

I only want/need vertical scrollbars to appear on my iframes. I have ensured that the width of the content of the iframe (ie: the page being displayed in the iframe) is no wider than the width of the iframe itself.

If I set scrolling="auto", then it displays fine in Firefox and Netscape, but in IE I get horizontal scrolling bars, despite the fact that the content is definitely not too wide for the iframe.

If I set scrolling="yes", then it displays properly in IE and Netscape, but in Firefox I get a "blank" horizontal scroll bar, which looks terrible.

Now, what really bugs me is that I have used iframes before and I've never had this same problem... I've re-examined my code a zillion times and still can't figure out why these particular iframes are having the horizontal scroll bar problem.

My code that DOES work:

<td width="465" height="400" rowspan="2" align="left" valign="top">
<iframe name="frame" src=welcome.htm frameborder=0 scrolling="auto" height=390 width=460></iframe>

My code that DOES NOT work:

<td width="560" height="380" align="left" valign="top">
<iframe name="frame" src=main.htm frameborder=0 scrolling="auto" height=380 width=550></iframe>

I searched on the forums and found this fix:

style="overflow-x: hidden; overflow-y: scroll;"

But I tried it and it didn't work.

Any ideas?

8:35 pm on June 28, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Try working with the html document that appears inside the iframe -- set body { width:95% } in your css for the iframed page.
8:43 pm on June 28, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member quadrille is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 22, 2002
posts:3455
votes: 0


And be sure to do all your testing on a small screen; many folk still have them, and many 23" webmasters never see the mess their pages get twisted into! ;)
2:08 am on June 30, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 25, 2006
posts:51
votes: 0


Okay, I figured it out! For some reason, I had forgot to set up margins on the page within the iframe, so it was messing things up.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members