Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3782480
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:05:20+00:00 2026-05-19T11:05:20+00:00

What I am trying to achieve is to have a scrollable, auto-re-sizable div inside

  • 0

What I am trying to achieve is to have a scrollable, auto-re-sizable div inside an iframe.

The problem is that iframe, unlike a div, has a scroll in itself, therefore the overflow-y property of my div is ignored, and entire content of my div is displayed, instead of a just a small portion.

The best explanation is a sample, which you can view by clicking
http://www.alocet.com/VictorsTestFolder/Sample/Default.html

When I’ve added CSS “html,body,form{ height:100%; margin:0px; padding:0px;}” to IFrame page, it almost worked, but unfortunately I wasn’t able to get rid of duplicate scroll-bars.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:05:21+00:00Added an answer on May 19, 2026 at 11:05 am

    I’m going to go out on a limb and say that you can’t really do the thing you want to do without JavaScript.

    Divs just don’t work like that. They typically overflow as far as needed, spilling wherever. The only way to keep a div from being sized according to its contents (I’m speaking on experience) is to give it an explicit height. Otherwise, it will either spill out of its container or, if its container is its own block formatting context, cause its container to start scrolling.

    The iframe appears to be its own context. Thus, you MUST set an explicit height if you want the div it contains to keep itself compact. Two options I see:

    You can add a parameter for the server to change the page’s height:

    <iframe src="Default_files/IFrame2.htm?h=400"
    

    Then, create a containing div for the whole page with a fixed height that fits within the iframe. Everything inside of it should flow properly. Then, set the div that might have a lot of content to a fixed size.

    The other option is to use JavaScript, which I think can obtain exactly the variables you’re looking for using document.documentElement.clientWidth. See this article for more details. Even in this case, you still end up setting the framed page to a fixed height.

    Both methods are sketchy workarounds, but I’m somewhat confident you can’t do what you want with just CSS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a IKImageBrowserView embedded inside an NSScrollView. I'm trying achieve scroll bars like
Here's what I'm trying to achieve: I have a div that switches between fixed
What I'm trying to achieve is a scrollable tab-bar. I have a web page
Here is what im trying to achieve. I have a perl script that looks
I have trouble setting directives in .htaccess file. Trying to achieve that if visitor
im trying to achieve something but i dont really know how I have set
I am trying to achieve an LDAP query to gather all properties we have
I have been trying very hard to achieve rounded corners with IE6+jquery ui tabs.
what I am trying to achieve is to have a persistent list of undoable
I'm trying to achieve something like you have in the back end of Wordpress

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.