Height that is left unused in Internet Explorer 8

I am striving for a layout similar to this in IE8 (&IE9).
I prefer not to use JavaScript, as some external entity is injecting content dynamically, which should only result in a different scrollbar scale.

I have spent a considerable amount of time searching for a solution. Unfortunately, I have been unsuccessful in comprehending or implementing the guidance provided in this thread: StackOverflow: make-iframe-to-fit-100-of-containers-remaining-height

<!DOCTYPE html>
<html>
    <body>
        <p>Some text with unknown height, fixed at the top.</p>
        <div>
            Some content that will not exceed the body (100% height),
            but will fill the body until the content is too long, which would give
            a scrollbar.
        </div>
    </body>
</html>

I have successfully achieved this in Chrome (see image = entire browser content), with the fiddler positioned at the bottom:

However, in IE8/9, I encounter this issue (see image = entire browser content, once again scrolled to the bottom of the body):

Chrome works perfectly fine in the fiddler example.

If anyone can offer assistance, it would be greatly appreciated.

Answer №1

Feeling frustrated by my lack of progress, I finally resorted to using JavaScript (as no one seemed able to provide a satisfactory answer to my question, and this solution isn't exactly what I was looking for).

JSfiddle

The JSfiddle showcases a more intricate code than what is displayed below as it includes additional elements that are necessary.

function adjustHeight() {

    var header = document.getElementById("header");
    var container = document.getElementById("container");

    container.style.top = header.clientHeight + "px";
}

// Take note of the method invocation location ('asap'), adjustHeight()
<body>
  <div id="header">
      <p id="p">
          Line1<br/>
          Line2<br/>
          Line3<br/>
          Line4<br/>
      </p>
      <div id="toggle">Toggle</div>
  </div>
  <div id="container">
      <script>adjustHeight();</script>
      <div id="content">
          First row visible<br/><br/>
          Scrollbar shows normally<br/>
          Body doesn't scroll<br/>
          Works on resize too (by default)<br/>
            [Additional content truncated for brevity]
          Last row visible on collapsed/expanded
      </div>
  </div>
</body>

Answer №2

It appears that you have opted for a div instead of an iframe, and I recommend using positioned elements as shown in this fiddle.

position:absolute;
bottom:0px;
top:80px;
left:0px;
right:0px;

http://jsfiddle.net/abc123/1/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am looking to modify the anchor link and image source using JQuery based on the specific div ID

Looking to update the link of an anchor and source of an image inside this div when clicking on the FR button. I need help figuring out how to do this with JQuery. Here's the code: <div id="my_id"> <a href="wwww.google.com&qu ...

Utilizing Jquery for draggable/droppable functionality in combination with custom overflow styles

Encountering a challenge with a drag and drop system that utilizes CSS overflow properties to enable vertical scrolling of a list of values. The issue arises when dragging an item between selected and unselected areas, causing the dragged item to disappear ...

Generate a random post on a Blogger page upon loading instead of clicking on it

I recently implemented a random post button on my website at . I am now looking to have a random post load automatically when the page loads instead of requiring users to click the button. Can anyone provide guidance on how I can achieve this? Below is t ...

The issue with implementing simple getElementsByClassName JavaScript in the footer of a WordPress site persists

I am facing an issue with a 1-liner JavaScript code in the footer where getElementsByClassName function doesn't seem to work for tweaking style attributes. The text "Hello World" is displaying fine, so I suspect it might be a syntax error? Here' ...

When is the best time and place to break out Yahoo's Mojito Manhattan cocktail mix?

Yahoo! made headlines earlier this month by unveiling their new Mojito framework, set to be open sourced in 2012. I've been eager to learn more about this promising framework but haven't had any success so far. Does anyone know where I can find ...

The horizontal rule element is not displaying

My <hr> element seems to be hidden. This is the HTML code: <div id="line"><hr /></div> And this is the CSS code: hr { border: 0; width: 96%; color: #FFFF00; height: 1px; } #line { float: left; width: 73 ...

Adding the Font Awesome fa-angle-right icon to a custom Bootstrap carousel: A step-by-step guide

Kindly review the code below. <a class="carousel-control-prev" href="#my-slider" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</sp ...

Automating the process of uploading a file to a Github repository using JavaScript and HTML

Recently, I've been tinkering with updating a file in my GitHub repository using code to set up an automated system for pushing changes without manual intervention. My approach involved creating a function that utilizes a GitHub access token to ' ...

I'm having trouble figuring out the issue with the HTML code I wrote to include a favicon on my website

Take a look at this code: <link rel = "shortcut icon" type = "image/x-icon" href = "C:/Users/SOMEBODY/Desktop/SOME FOLDER/ANOTHER FOLDER/favicon.ico"/> Even though I have the favicon in the same folder as my website, ...

Addressing rendering problems in Ag-GRID when used with Angular

I'm facing a perplexing issue where the ag-grid table in my Angular 12 / Bootstrap 5 application renders with a height of 0px. Below is the link to the rendered table: rendered table Upon inspecting with Chrome's debug tool, I noticed that the ...

Struggling with html code?

Struggling with some school work and facing a challenge. I need the menu to be centered, but it's not cooperating. My teacher was no help, so I'm turning to this website for assistance. This is what I have come up with: * { background-col ...

Require a selection from the menu on the right side needed

I am looking to have the logout link displayed on the far right when the other menu items are hidden. Currently, it is appearing in the center. Is there a way I can make it show up on the right? <div class="nav-content container"> &l ...

What methods can I use to display or conceal certain content based on the user's location?

I'm looking to display specific content exclusively to local users. While there are APIs available for this purpose, I'm not sure how to implement them. I'm interested in creating a feature similar to Google Ads, where ads are tailored base ...

What is the best way to manage fonts in bootstrap-sass and compass? Are there any specific guidelines for properly integrating fonts into a webpage?

Within my Node.js application, I utilize bootstrap-sass in conjunction with Compass. Omitting the use of gulp-compass and related tasks, specifically relying on Compass itself, I have placed the Compass config.rb file in the root directory of my app. To co ...

Animating elements with folding effects using CSS transforms

Check out this square: https://jsfiddle.net/34f93mL3/ If you hover over it, you'll see that the top folds down and turns into a pink polka-dotted pattern when it reaches the bottom. However, my goal is to make it look more like an actual folding mot ...

Using Javascript/JQuery to attach a javascript object to a form in order to perform a traditional form

On a page, there is a form that consists mostly of plain HTML. One section of the form creates a quite complex multidimensional object using JavaScript. Usually, if I wanted to include a variable in the POST request, I would add an <input type="hidden" ...

What is the best way to assign a unique color to each circle?

Struggling to assign random colors to each circle in my canvas. Currently, they all have the same color that changes upon refresh. I'm aiming for unique colors on each circle but my attempts have been unsuccessful so far. Check out my code below: v ...

Generating a PDF file from an HTML and CSS page can be done without relying on APIs or libraries, by leveraging the

Is there a way to directly convert an HTML page generated using PHP and CSS into a PDF format without the use of libraries? I have come across multiple libraries that can accomplish this task, but I would prefer not to rely on any external libraries and i ...

Troubleshooting: jQuery Drop event is not triggering

I am attempting to transfer links (.link) from one div (.folder) to another, but the drop event is not triggering. To make all .link divs droppable areas, I have disabled the default behavior in the dragenter and dragover events. Here is the code snippet: ...

Ways to determine if an element is the initial child

I am currently facing issues while attempting to make my bootstrap carousel dynamic and inject data properly. My aim is to locate the first child of the injected data and apply the "active" class to it. I am utilizing Laravel Blade for rendering my data. B ...