Welcome to WebmasterWorld Guest from 54.226.62.26

Forum Moderators: incrediBILL

Message Too Old, No Replies

iframe Horizontal Scroll Bar Hassle

Old problem, any new ideas?

     

lateatnight

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

5+ Year Member



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?

tedster

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

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



Try working with the html document that appears inside the iframe -- set body { width:95% } in your css for the iframed page.

Quadrille

8:43 pm on Jun 28, 2006 (gmt 0)

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



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! ;)

lateatnight

2:08 am on Jun 30, 2006 (gmt 0)

5+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month