Question

IFRAME horizontal scroll bar always appears in IE6 on PC regardless of content width

Asked by: jamest521

I have a page with an embedded IFRAME coded as follows:

<iframe src="framecontent.html" width="505" height="380" frameborder="0"></iframe>

The target page contains a table of 483px wide with only text contained therein.

I have tested this page on a PC & Mac on with all popular browsers. For some reason on IE (specifically IE6 on XP Pro) when the vertical scroll bar appears so does the horizontal, even though the content does not exceed the size of the frame.

I have tried reducing the width of the table but the scroll bar remains. Is this a "feature" of IE?

Is there a way to control the scroll bars independently? I do have some pages that need to scroll vertically and some that do not, but certainly I do not need any horizontal scrolling.

Thanks,
James

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-03-23 at 12:53:52ID21362380
Tags

iframe

,

scroll

,

ie6

,

bar

Topic

Hypertext Markup Language (HTML)

Participating Experts
3
Points
500
Comments
22

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. transparent iFrame
    <IFRAME id=FrameStage name=FrameStage SCROLLING=no frameborder="0" style=" POSITION: ABSOLUTE; LEFT: 138px; TOP: 26px; WIDTH: 492px; HEIGHT: 369px; POSITION: absol...
  2. Iframe with an embeded SWF is not loading in IE6, Is this …
    I have the following iFrame which loads a flash movie (swf) In IE6 when it outputs, I see the iFrame as a white box, however the SWF movie doesn't load in IE6, only in IE7, Firefox, Safari. Here is the code: <iframe src="http://movie.sample.com/search.php?link=803...
  3. zindex/iframe nightmare in IE6
    I'm having a TON of trouble implementing what appears to be the "common" fix for IE6 when you have a select form box displaying on top of a drop down menu. No matter what I try, I can't get it to work. I am using a basic javascript drop down menu and have attached...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: COBOLdinosaurPosted on 2005-03-23 at 14:16:04ID: 13616643

<iframe src="framecontent.html" width="505" height="380" frameborder="0"
style="overflow-x:hidden"></iframe>

If that does not solve it, the you will probably have to do it the hard way and modify the body tag of the page being loaded:

<body style="overflow-x:hidden">

Cd&

 

by: jamest521Posted on 2005-03-23 at 14:43:22ID: 13616887

Well, I tried every possible combination of your suggestion:

In the body tag of the page containing the IFRAME
In the body tag of the page that fills the IFRAME
In the style sheet on both pages

And unfortunately the horizontal bar is still there...

 

by: COBOLdinosaurPosted on 2005-03-23 at 15:17:56ID: 13617209

Give ua a link to the page so we can see what is going on please.

Cd&

 

by: jamest521Posted on 2005-03-23 at 15:54:24ID: 13617415

 

by: COBOLdinosaurPosted on 2005-03-23 at 16:07:34ID: 13617507

That generated code.  You used Dreamweaver.

1.  Put in a full doc type so you are not rendering in quirks mode.
2. run the page through a validator at www.w3c.org and cleanup the DW garbage.
3. Once the code is clean it may correct it self.  IF not at least we will have something we can work with.

Cd&

 

by: jamest521Posted on 2005-03-23 at 16:13:32ID: 13617541

OK - will do...thanks so far!

 

by: sciwriterPosted on 2005-03-23 at 19:13:42ID: 13618483

I've encountered the same problem -- you should use something like this --

<IFRAME name="list" id="list" src="list.html" width="120" height="500" bgcolor="transparent" border="0" frameborder="0" marginheight="0" marginwidth="0" scrolling="NO">     </IFRAME>

The key there is scrolling = NO.

If you declare the Iframe a lot longer than you want it (assuming you have the room on the page), it will cover most scenarios.  If you declare the SCROLLING=AUTO  -- which is another option, it might work better for you.

That means the Iframe will show no scroll bar if the size is less than the height, if it is near, equal or greater, it will show the scroll bars.

On word of caution -- I have found that declaring the Iframe features is a class style declaration does not do it for all features.  Some need to be declared right in the Iframe declaration, as I have shown you above.  Experiment to see which will work in the CSS style decaration, and which won't.

 

by: jamest521Posted on 2005-03-24 at 07:15:28ID: 13622350

As you probably saw from the sample page, I am limited by the page size so the IFRAME height cannot be changed. Using the paramters you suggested leaves me with no scroll bars and fixed conent. Switching to AUTO of course brings back both x & y scroll bars.

Did you manage to get your x scroll bard to disappear in your scenario?

Cheers,
J

 

by: sciwriterPosted on 2005-03-24 at 09:59:16ID: 13624227

Yes, because the screen was wider than the display size.  You don't have to use that fixed width, my point was, you can calculate the width based on your size of display.  If you have to make the box wider than the display size, the scroll bars will always show.

 

by: jamest521Posted on 2005-03-24 at 10:11:30ID: 13624329

I guess this is where my expertise runs out. I am not sure how to adjust width, etc. based on screen size. In other words, I'm not getting it.  Sorry.

Thanks,
J

 

by: sciwriterPosted on 2005-03-24 at 10:46:27ID: 13624664

I guess the reason I was confused, thinking you meant the vertical scroll, is because I don't see the horizontal one.  But sure enough, pop into IE, and it is there.  So I'm sorry for misunderstanding which one you wanted to eliminate, seeing only one.

Other than trying the suggestions above, you could try fine tuning the display width in the page loading into the iframe, since it is close to the iframe size, IE is defalting to showing the horiz scroll.  eg. 480.

Also, do you have one of these at the top of your document --  
"http://www.w3.org/TR/html4/strict.dtd"
"http://www.w3.org/TR/html4/loose.dtd"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

Those will cause IE to render differently, as also noted above.

 

by: jamest521Posted on 2005-03-24 at 11:10:24ID: 13624871

I have added the DOCTYPE statement - no change to the scroll bar display.

As you might have guessed, I have played with the width of the page that loads into the IFRAME, reducing it to as much as 200px wide, I have included only text and not the table and text that is there now, and so on - no change to the scroll bar under any circumstances to date.

FYI: pages in question are:

Main page:      http://lextranet.mjusa.com/smarttools/lextranet/benefits.html
Frame page:   http://lextranet.mjusa.com/smarttools/lextranet/benefitsframe.html

J

 

by: chrome_geckoPosted on 2005-03-28 at 13:14:06ID: 13647151

as sciwriter pointed out that is what to do...

incase you misread what sciwriter said,

try the

"http://www.w3.org/TR/html4/strict.dtd"
"http://www.w3.org/TR/html4/loose.dtd"

in the place of the "http://www.w3.org/TR/html4/frameset.dtd" statement

I have also had this problem with IE, but when using a better browser *Firefox* you never get those problems

 

by: sciwriterPosted on 2005-03-28 at 13:57:45ID: 13647476

Chrome -- tell me this -- I had an Iframe working perfectly without ANY DTD specification.  It still does.  But when I put either strict or loose DTD in the top -- the Iframe doesn't even show to the correct height!!!  Mine is about 1200px high, and when I specify strict OR loose, it chops it down to about 100 pixels high.  That is VERY baffling, since I specificed the height BOTH in the <TD> enclosing the Iframe, and in the Iframe itself !!!!  :(

 

by: jamest521Posted on 2005-03-31 at 06:50:09ID: 13671936

Tried the alternate specification in both the pages - no difference. I have of course tested this site cross-platform/cross-browser and I have obsevred the other conmbinations displaying the page without the H scroll bar.

However, the web site in question is a front end to a site that relies heavily on ASP and Active X controls and as such site visitors are expected to use IE. (Regrettaby that part of the site is out of my hands). So the customer wants a site that works in IE first and everything else second.

Thanks for all the input but I am now at a loss as to how to fix this issue.

Cheers,
J


 

by: sciwriterPosted on 2005-03-31 at 10:44:16ID: 13674322

<<<iframe src="framecontent.html" width="505" height="380" frameborder="0"></iframe>
The target page contains a table of 483px wide with only text contained therein. >>

The width of the Iframe needs to be no wider than the table or <TD> width that the Iframe is going into.  Can you not make this adjustment?

 

by: jamest521Posted on 2005-03-31 at 10:57:53ID: 13674441

I adjusted the IFRAME to 450px wide. I adjusted the content page to 400px wide. The scroll bar is still there....

J

 

by: sciwriterPosted on 2005-03-31 at 11:04:30ID: 13674503

You might be interested in something I recently discovered.  I had an Iframe in a table working perfectly in both browsers, just as you are wanting to do.  Then I was experimenting with different IE renderings using the two DTD's mentioned above.  Putting either loose or strict in caused IE to completely screw up the Iframe rendering.  It shrunk to less than it's width, and only about 20% of its height.  I did not try the frameset DTD spec, because all I had to do was remove ALL such specs, and the Iframe rendered perfectly once again.  In other words, nothing in the header but --

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML> ..etc

 

by: sciwriterPosted on 2005-03-31 at 11:07:01ID: 13674524

And I forgot to mention, scroll bars appeared, whereas I had no scroll bars before, and had even specificed SCROLLING = "NO"  -- which was apparently ignored when a DTD was specified....

 

by: COBOLdinosaurPosted on 2005-03-31 at 11:18:59ID: 13674631

Do the arithmetic.
As I look at the page:
the iframe is constrained to a width of 450 px
The primary element in the content page is 400 px --- this is irrellevant because
the heading line declares to cell widths 18 and 465 ======> 483 px

IE expands a table to fit the more granular cell specifications there fore the width of the table and th content is 483 and it is going to be 483 as long as the cell widths add up to 483 and the iframe is going to need scrollbars at any width less than 483 ( probably a little mor given IEs weak box model).

Cd&

 

by: jamest521Posted on 2005-04-01 at 07:10:22ID: 13681437

Thanks to all for the comments - turns out that sciwriter nailed it withthe doctype statement without any specific doucment attached.

J

 

by: sciwriterPosted on 2005-04-01 at 09:50:12ID: 13682793

Amazing but true!  Glad I helped.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...