The size of the position fixed element in IE11 is incorrect

Can you explain why IE11 incorrectly sizes a fixed positioned element when its parent has a relative position with specific dimensions, border-radius, and hidden overflow? In this scenario, the fixed element ends up taking on the size of its parent instead of setting its own size.

For instance:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-CH" lang="de-CH">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>Fixed Test</title>
    <style>
    div {
      position:         relative;
      overflow:         hidden;
      min-height:       100px;
      width:            200px;
      border-radius:    5px;
      background-color: green;
    }
    .fixed {
      position:         fixed;
      top:              0;
      left:             0;
      height:           100%;
      width:            100%;
      z-index:          1000;
      background-color: red;
    }
    </style>
  </head>
  <body>
    <div><span onclick="this.className='fixed'">click me</span></div>
  </body>
</html>

Answer №1

After analyzing this behavior in comparison to Chrome, it appears that the key factor is the use of overflow: hidden. There may be a specific explanation for this in the specifications, but I believe Internet Explorer might actually have the right approach in this case - or at least partially. When experimenting with it, the fixed span element took on the width and height of the entire viewport but was not fully visible due to the masking effect caused by the overflow attribute of its containing div. Removing that attribute resulted in the entire screen turning red.

Despite this, there was still an issue with creating a straight edge in the upper left corner, which seems to be incorrect from a design standpoint.

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

Dimensions of images on Read the Docs (small image widths)

Using MkDocs along with the Read the Docs theme, I am facing an issue with small images not scaling properly on mobile devices. It seems like this problem is related to the CSS of Read the Docs theme, but I'm unsure how to override the default behavi ...

Is it possible for the Jquery Accordion to retract on click?

Hello everyone, I've created an accordion drop-down feature that reveals content when the header of the DIV is clicked. Everything works fine, but I want the drop-down to collapse if the user clicks on the same header. I am new to JQUERY and have trie ...

What is the best way to modify and execute js and css (less) files dynamically using ajax and jQuery?

Whenever I click a button, an ajax call is triggered to load various html code into a div with the id 'main'. While displaying the html content is not an issue, integrating and applying css and js code to my current page has proven to be challeng ...

assistance needed in setting up an HTML nested list for a sub navigation menu

I'm encountering an issue with my nested list that is used to create a subnav. It's currently positioned absolutely, but its parent cannot be relatively positioned as the overflow on the parent's parent is hidden, preventing the full sub nav ...

Aligning the email form to the center with the text-align center property:

I'm in the process of creating an app landing page using the Bootstrap framework (Bootstrap 4 alpha). I have used text-align:center in the jumbotron id to center everything, but the email form is not aligning properly. Is there a way to center align ...

Steps to avoid the letter "e" from being copied into the input field using Vue.js

<vs-input :value="contract.value" :class="isMobileOnly ? 'w-full' : 'w-1/2'" class="mx-auto" type="number" ...

Displaying complex JSON data in an HTML format using JavaScript

How can I convert the second array of entities into an HTML format from the JSON data using a for loop or similar method? To access the necessary data, I currently use console.log(data.response[0].entities.urls); $(document).ready(function () { $.getJSO ...

Move content off the screen using CSS3 translation

Throughout various projects, I have encountered the need to make elements on a webpage translate out of view (essentially making them fly out of the document). The idea was that by simply adding a class to the element, the CSS would take care of the animat ...

Move images horizontally next to the height of an element

I am attempting to increase the top attribute in relation to the element it is currently adjacent to. The element should only scroll directly next to the other element and cease when it surpasses the height of that element. My Goal: I want the image to re ...

Issues with JQuery scroll() / scrollTop() functionality in Internet Explorer and Firefox

Our current script showcases a dotted line starting from the top of the screen leading to an up arrow. The position of the arrow changes based on how far the user has scrolled down the page, allowing them to click on the arrow and scroll back to the top. W ...

Are you familiar with a cutting-edge HTML5-powered, heritage-defying JavaScript framework?

Which cutting-edge framework should I choose to fully utilize the latest HTML5 technologies provided by modern browsers like Firefox 7, Safari 5, and Chrome 14? I have no need to support any older browsers such as IE, Firefox, or Chrome versions prior to t ...

How can I reset an ng-model value of a range input in AngularJS?

Utilizing a filter with two inputs that share the same ng-model concurrently: <!-- Number input --> <input type="number" maxlength="5" step="0.25" min="-10" max="10" placeholder="0.00" ng-model="sphere"> <!-- Range Input --> <input ...

Center the search box in responsive mode

I am utilizing a bootstrap navigation bar as shown in this source. My aim is to ensure that on mobile devices, users do not have to click on the menu icon to search on the page. I want to display the search box immediately after the Brand in responsive mod ...

Tips for choosing text within an HTML <label> tag

Here is the HTML code provided: <label for="xxxx" id="Password_label"> <div class="xxxx">Password 555</div> 555 <div class="xxx"></div> </label> I am attempting to replace the text "555" that appears inside th ...

Fonts appear altered on a Windows computer

Working on my new website watr.io, I've noticed that the font appears differently on Windows versus Mac. The one displayed on Mac is the desired outcome, but I can't seem to figure out what's causing the discrepancy. I've been troublesh ...

Is there a way to execute jQuery code only after AngularJS has finished rendering all its components?

My goal is to display or hide my chart div based on different pages (Add, Edit, Save As). This functionality should be controlled by a checkbox - when the checkbox is checked, the div is displayed, and when it is unchecked, the div is hidden. On the Add ...

The button can only be edited using Internet Explorer

My webpage features a button that displays correctly in Chrome, but the text inside the button gets cut off when viewed in IE (see image). Can you provide guidance on what might be causing this issue and how to resolve it? Bootstrap version 4.0.0 is also b ...

Center-aligned Bootstrap column with a width of 50% and centered vertically

I am looking to have images and videos displayed side by side on my webpage. The code below functions properly, however there is an issue with the alignment. While the horizontal center alignment is correct, the video and images are not centered vertically ...

My div won't stay fixed in the layout no matter what I try

Being fairly new to css, divs, and everything in between, I decided to create a simple layout for my band without unnecessary links like bio or merch store. Instead, I wanted separate spaces for our video, music player, and a Facebook window. I successful ...

Abnormal scrolling issues observed on handheld devices like mobile phones and tablets

I recently added a parallax effect to the hero section of my website, and while it works perfectly on desktop, I encountered some scrolling issues when viewing it on mobile or tablet devices. Sometimes the scrolling behaves as intended, and other times it ...