...

View Full Version : Iframes & Horizontal scrollbars even when overflow-x:hidden



kpelvoivner
12-27-2005, 07:16 AM
IE is beginning to piss me off? why can't they have just a horizontalscroll="off" thing in HTML. My pages look perfect in Firefox and Opera, but IE insists on putting a horizontal scrollbar in ANY page that has to scroll vertically. I've tried overflow-x:hidden and it didn't work in IE. I tried overflow-y:hidden just to see and it worked in Firefox and opera, but not in IE. I then tried overflow:hidden and IE didn't even accept that one.
Anyway, it's really an aesthetic problem, but aesthetics are kinda important for an art website. Is there ANY way to over-ride IE and completely disable a horizontal scrollbar for a frame? PS I've tried putting that overflow code in the main page, the iframe's page, and even the iframe tag's style. On a side rant? How come Opera and Firefox can obey code so much easier than IE? Thanks in advance for any help. I browsed the forums already looking for answers to the question and found the question a few times but no answers that actually worked.

This is what I've got right now that doesn't work:
<td valign="top" width="628px" style="background-color:white "><iframe name="content" id="content" frameborder="0" src="news.htm" height="380px" width="628px" style="overflow-x:hidden ">&nbsp;</iframe></td>

mark87
12-27-2005, 12:41 PM
The only thing you can really do is add scrolling="no" to the HTML of your iFrame. This will stop all scrollbars though. :(

harbingerOTV
12-27-2005, 12:55 PM
I think the real culprit maybe the page your loading into your Iframe. In the code you posted that would be 'news.htm'. What does the code of that page look like? Since your content Iframe is 628px wide, make any page being linked into the iframe no wider than 610px. You need to leave room for the vertical scroll bar. The iframe inner width is actually the width of the scroll bar (16-18px) + the width of the page being loaded into the iframe.

armyman
12-27-2005, 07:25 PM
this should work it dose for me


<td valign="top" width="628px" style="background-color:white ">
<iframe name="Content" id="content" frameborder="0" src="news.htm" height="380" width="628">&nbsp;</iframe></td>


make shure u have news.htm uploaded to your web or just do


<iframe src="news.htm" name="content" width="628" height="380" frameborder="0"></iframe>

kpelvoivner
12-28-2005, 03:22 AM
I think the real culprit maybe the page your loading into your Iframe. In the code you posted that would be 'news.htm'. What does the code of that page look like? Since your content Iframe is 628px wide, make any page being linked into the iframe no wider than 610px. You need to leave room for the vertical scroll bar. The iframe inner width is actually the width of the scroll bar (16-18px) + the width of the page being loaded into the iframe.

How do I set the width of the page being linked? Can't say I've ever set a page width before... just the width of what the content is being contained in.
and armyman... I don't see what you changed other than removing the style that tells it (theoretically and unsuccessfully) to not show a horizontal scrollbar. :-P

As for what the news.htm looks like. it's got some pictures floated to the left alignment and has text left justified next to the images and I've even tried giving it a big right side margin... didn't do anything except give more white space on the right side while maintaining the horizontal scrollbar.

harbingerOTV
12-28-2005, 03:32 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>610px iframe page</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
#container {
width: 610px;
background-color: #fc3;
height: 1000px;
}
</style>
</head>
<body>
<div id="container"></div>
</body>
</html>


Try saving that as your news.htm file and see if you get a scrollbar in the Iframe.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum