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

  • Home
  • SEARCH
  • 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 8663493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:59:50+00:00 2026-06-12T16:59:50+00:00

I have a simple HTML page with a sidebar floated to the left and

  • 0

I have a simple HTML page with a sidebar floated to the left and all content to the right. In the main content area I have an <iframe>. However, when I use CSS to set the height of the frame to 100% it seems to overflow the containing div for some reason, resulting in a small amount of white-space after my content.

Here is my HTML content:

<div id="container">
    <div id="sidebar">
        <p>Sidebar content</p>
    </div>
    <div id="content">
        <iframe id="contentFrame"></iframe>
    </div>
</div>

And here is my CSS:

html, body {
    height: 100%;
}

#container {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    background-color: grey;
}

#sidebar {
    width: 100px;
    float: left;
    background-color: blue;
    height: 100%;
}

#content {
    margin-left: 100px;
    height: 100%;
    background-color: yellow;
}

#contentFrame {       
    border: none;
    padding: 0;
    margin: 0;
    background-color: pink;
    height: 100%;
}

(NOTE: Before anybody asks, #container { position: absolute } is necessary for layout reasons; I can’t change that.)

You can see it ‘working’ on this fiddle: http://jsfiddle.net/9q7yp/

The aim is to get rid of the white band along the bottom of the page (i.e. there shouldn’t be a vertical scroll-bar in the result). If I set overflow: hidden for #content then the problem goes away. I’m happy to do this if necessary, but I can’t for the life of me work out why it doesn’t work without this. Can anyone tell me why?

  • 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-06-12T16:59:51+00:00Added an answer on June 12, 2026 at 4:59 pm

    Try to add

    display:block;
    

    to the iframe. http://jsfiddle.net/9q7yp/14/


    Edit:

    Well, it turns out there’s a better solution (both in practice and in understanding what’s going on):

    Add

    vertical-align:bottom;
    

    to iframe#contentFrame. http://jsfiddle.net/9q7yp/17/

    <iframe>, as an inline element, has the initial value of vertical-align:baseline, but a height:100% inline element will “push” the base line a few pixels lower (because initially the baseline is a few pixels higher from the bottom),

    so the parent DIV is thinking “well content will be 2 pixels lower, I need to make room for that”.

    You can see this effect in this fiddle (check your browser console and pay attention to the bottom property of both ClientRect object).

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

Sidebar

Related Questions

I have a simple HTML page that contains two tabs that show/hide content in
I have a simple HTML-page with a UTF-8 encoded link. <html> <head> <meta http-equiv="content-type"
I have a simple html page/app with all of the common meta:og tags. PROBLEM:
I have a simple HTML page that looks like this: ...<div id="main"> <a href="#">Click
I have simple HTML page with svg like this: <div id=plan> <svg xmlns=http://www.w3.org/2000/svg version=1.1>
This is bugging me ... I have a simple HTML page that has a
I'm using PeerTracker http://en.wikipedia.org/wiki/PeerTracker to track torrent hashes. I have a simple HTML page
I have a very simple html page with the following javascript in it $(function()
In a simple html page I have: <SCRIPT> function Clicker(number){ if (number == 1)
I have a simple html form. On php page. A simple list is placed

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.