Jump to content

Need To Prevent Scrolling In Iframe


Recommended Posts

k, so i have an iframe in the center of my design where content for the subpages show up when the user clicks on targeted links.


on the first page, i need it to look like there is no frame there, so there is a graphic that is exactly the size of the iframe that fits the layout of the rest of the site.


basically i need to make sure no scrollbars show up on this page, but i can't disable them entirely on the iframe because some of the content pages need vertical scrolling.


i have set margins/etc on the page with the perfectly sized image so that in Safari and IE on the Mac (at least), there are no scrollbars. IE on Windows, however, puts scrollbars there. I want it to _not_ do that. :)


here's my disheveled site in whatever current form it's in...




and here's the css for the page inside the iframe with the graphic (which is the same size as the iframe):

>.mainimg {
position: absolute;
top: 0px;
left: 0px;
border: none;
margin: 0;

body {
margin: 0;

and in the body:

bgcolor="white" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

then img src="img/req/homegraphic.jpg" width="508" height="264" style="mainimg"


any ideas?




Link to comment
Share on other sites

the first rev had no margins/etc set. i think adding them is what got rid of the scrolls in the two mac browsers (safari/ie)... now i just gotta get them gone in windows ie.


where would i stick height=90% ?




Link to comment
Share on other sites

Just behind the margins.

I came across this in a HTML course. Not sure if it fits this problem but it was mentioned as preventing a scrollbar.

looked at html courses (In dutch so links won't help you:) ) but haven't found an answer yet. I am not in a position (read, at work) on trying it out myself or dug in real deep.

So I leave it at this..


Good luck,




Link to comment
Share on other sites

One thing that might help is, in addition to your margin:0; declaration, add padding:0;.


And you could use the height:90%;width:90%; as suggested above. You might only need to use 99%, or 98%, or . . . experimentation I guess. That would go in the code of the page being displayed in the frame, not the code of the frame itself.


Sadly, there may be nothing you can do in the end, because Microsoft always knows better.

Link to comment
Share on other sites

raul - sorry, i didn't see the edit button (duh) -- i reported the thread and told whomever to delete it as i had reposted it. sorry for the double post.


as for the problem, i fixed it!


if anyone is curious, i added this to the img tag and the scrollbars went away in Windows IE:


>hspace="0" vspace="0" align="top"


that's it!



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...