The minimum height of the IE element could not fully expand within its flex container that was set to absolute positioning

Creating a webpage with a full-page layout using a content session that spans the entire height of its container is my current project. To achieve this, I have implemented the following:

  1. The content's container (div.inner) is set to be absolute-positioned with
    display: flex; flex-flow: column; min-height: 100%;
  2. The content-session (div.content) has properties flex-grow: 1;

In order to create a full-paged effect and enable fading content-switching, it was necessary for me to position the content's container absolutely. However, I am encountering an issue as this implementation works only in Chrome and not in IE11. Does anyone know of any workaround or solution for this problem?

Thank you in advance.

    html, body {
      height: 100vh;
    }

    .outer {
      position: relative;
      height: 100%;
    }

    .inner {
      display: flex;
      flex-flow: column;
      position: absolute;
      top: 0;
      right: 0;
      left: 0;
      min-height: 100%;
      background-color: lightgreen;
    }

    .no-span-content-upper {
      background-color: lightpink;
    }

    .span-content {
      flex-grow: 1;
      background-color: lightblue;
    }

    .no-span-content-lower {
      background-color: lightyellow;
    }
    <html>
      <head></head>
      <body>
        <div class="outer">
          <div class="inner">
            <div class="no-span-content-upper">
              some dummy content without specific height
            </div>
            <div class="span-content">
              span content here
            </div>
            <div class="no-span-content-lower">
              some dummy content without specific height
            </div>
          </div>
        </div>
      </body>
    </html>

Answer №1

Using the coordinates bottom:0; also helps in some cases However, it may not be suitable for your specific scenario...

html, body {
      height: 100vh;
      margin:0;
    }

    .outer {
      position: relative;
      height: 100%;
    }

    .inner {
      display: flex;
      flex-flow: column;
      position: absolute;
      top: 0;
      right: 0;
      left: 0;
      bottom:0;
      min-height: 100%;
      background-color: lightgreen;
    }

    .no-span-content-upper {
      background-color: lightpink;
    }

    .span-content {
      flex-grow: 1;
      background-color: lightblue;
    }

    .no-span-content-lower {
      background-color: lightyellow;
    }
<html>
      <head></head>
      <body>
        <div class="outer">
          <div class="inner">
            <div class="no-span-content-upper">
              Placeholder text without a defined height
            </div>
            <div class="span-content">
              Insert span content here
            </div>
            <div class="no-span-content-lower">
              Placeholder text without a defined height
            </div>
          </div>
        </div>
      </body>
    </html>

The workaround using height or min-height:100% / vh + flex-flow : column; needs the parent element set to 100% with flex column to function properly in IE due to a known bug (potential duplicate). To avoid this issue, an additional wrapper is required, typically involving the html and body elements, but in this case, due to the use of absolute : position, an extra wrapper must be added as the absolute one. ;)

html,
body,
.outer-buffer {
  height: 100vh;
  margin: 0;
}

.outer {
  height: 100%;
  display: flex;
  flex-flow: column;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
}

.inner {
  display: flex;
  flex-flow: column;
  flex: 1;
  min-height: 100%;
  background-color: lightgreen;
}

.no-span-content-upper {
  background-color: lightpink;
}

.span-content {
  flex-grow: 1;
  background-color: lightblue;
}

.span-content div:hover {
  height: 200vh;
}

.no-span-content-lower {
  background-color: lightyellow;
}
<html>

<head></head>

<body>
  <div class="outer-buffer">
    <div class="outer">
      <div class="inner">
        <div class="no-span-content-upper">
          Placeholder text without a defined height
        </div>
        <div class="span-content">
          Span content goes here<br>
          <div>Hover over me to overflow container</div>
        </div>
        <div class="no-span-content-lower">
          Placeholder text without a defined height
        </div>
      </div>

    </div>
  </div>
</body>

</html>

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

Scrolling horizontally with scrollbar functionality

My goal is to create a webpage with a horizontally scrollable DIV element in the center, where the scrollbar appears only at the bottom of the DIV, not at the bottom of the entire page. I am wondering if it is possible to have a scrollbar placed at the ve ...

Specifying Size of Icons in HTML and CSS

Displayed in the image below are 3 icons - 2 of them are the same size, while one (on the left) appears larger and uneven compared to the other two. This snippet demonstrates the HTML code related to this section: <article class="number"> ...

Add motion to the div element when hovering and moving the mouse away

Looking to add animation to a list moving from left to right and vice versa. Now, I want the list to animate from left to right when the mouse hovers over the div, and then animate from right to left when the mouse leaves the div. Can someone assist me wit ...

Flex wrap is causing additional space within the layout

When using flex-wrap, if there are more textBoxes than the available width in the container, they shift to the next line. This is fine, but it leaves too much space between the button and the textBox. This spacing issue can make the layout look odd. I hav ...

Whenever the user hits the "Enter" key, a new element will be generated and added to the bottom of an existing element

I am in need of creating a new element at the end of another element. For instance, let's say I have this element: <div id="elmtobetrig">Element that should be followed by another element when the user hits enter after this text. <! ...

Cross-Browser Compatibility of CSS

I have noticed that lists styled with the following CSS code appear differently in Internet Explorer 8 and Firefox 4. In IE8, the rounded corners are missing, while FF4 does not change color when hovering over it. Which browser should I trust for accurate ...

Three Divisions Positioned at the Top, Middle, and Bottom

I need to place 3 divs at the top, middle, and bottom positions. To achieve this, I have used jQuery to calculate the viewport height and apply a percentage of it to the top and bottom divs. However, resizing the page causes issues as the middle div overl ...

Exploring Angular's Animation Feature for HTML Element Movement

I'm currently using @angular/animations module to animate HTML objects and I want to move an object when a button is clicked. For example: * The object initially has top: 800px, left: 800px * Clicking the 'W' button should move the obje ...

Cross Domain Requests in Internet Explorer: Preflight not being sent

I have come across several similar discussions but none of the solutions provided have worked for me so far. Issue: In our current setup, we have three servers hosting our http-apis - two for testing and one for production. Lately, we have been deployin ...

What is the best way to call a JavaScript function within a PHP echo statement that outputs a <div> element?

Having trouble echoing this PHP code due to issues with single quotes, causing the HTML to end prematurely. Any suggestions on how to fix this? function button($conn){ $sql = "SELECT * FROM table"; $result= mysqli_query($conn, $sql); while($r ...

Using Cascading Style Sheets (CSS) to make posts appear above an image in a scrolling format

Can anyone guide me on how to show the text above an image contained within a scroll bar, similar to the picture below? Despite trying position property and searching online, I haven't found a solution yet. Your help would be greatly appreciated. ...

Issues with JavaScript causing slideshow to malfunction

I'm experiencing some issues with my image slider. It seems that during the initial loop, the slideshow keeps reverting back to 'image3'. However, after the first loop, everything appears to work correctly. I am looking for a solution to ens ...

Switch between Fixed and Relative positions as you scroll

Just a small adjustment is needed to get it working... I need to toggle between fixed and relative positioning. JSFiddle Link $(window).on('scroll', function() { ($(window).scrollTop() > 50) ? ($('.me').addClass('fix ...

Changing innerHTML with HTML generated by a PHP function? (utilizing xajax)

I have managed to successfully update the content inside a DIV using xajax when clicking a link. However, I noticed that it only works when I directly assign HTML within the function itself, not when calling it from another function. Allow me to demonstra ...

Utilizing D3.js: Applying Multiple Classes with Functions

My current project involves using D3.js and I've encountered a particular challenge that has me stumped. In the CSV file I'm working with, there are columns labeled "Set" and "Year". My goal is to extract values from these columns and use them a ...

In relation to CSS and HTML

I recently started working on a website built with HTML/CSS and encountered an issue with links highlighting when hovered over. The problem arises from the main image on the homepage containing an embedded link, causing the area under it to also highlight ...

Looking for assistance with aligning UL elements in CSS using absolute positioning for a dropdown effect

I'm currently working on implementing a language switching feature on this website. The concept involves using a SPAN element that reveals a dropdown box (based on UL) containing a list of available languages when hovered over. Below is a preview of t ...

Leveraging ng-click and ng-hide/show directives within ng-repeat in Angular

I have a simple Single Page Website built with Angular. I utilized ng-repeat to generate content on the main page, where each item is an image. I am looking to create an alternate view for each image to display more details. I have implemented this feature ...

What could be the reason behind the failure of my inner div to successfully implement the flex-row

I'm currently trying to position two divs next to each other horizontally, and my concept was to utilize flexbox, but including the property flex-row doesn't seem to yield any results and I can't comprehend the reason behind it. How can I a ...

Is it possible to integrate Scrapy with the Chrome Browser?

Scraping a web page that utilizes javascript-rendered AngularJS can be tricky. The developers of the site have implemented a feature to detect Safari/Firefox in private browsing mode and prevent scraping. Interestingly, this warning does not appear when us ...