What could be causing the issue with flexbox centering not functioning properly in Internet Explorer 11?

Check out my simple animation HERE:

My query is about the flexbox centering code applied to the body element:

HTML:

 <body class="loading-doc">
    <div class="loader">Loading...</div>
</body>

CSS:

.loading-doc  {
    position: fixed;
    height: 100vh;
    width: 100vw;
    background: #fff !important;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align:center;
    -webkit-align-items:center;
        -ms-flex-align:center;
            align-items:center;
    -webkit-box-pack:center;
    -webkit-justify-content:center;
        -ms-flex-pack:center;
            justify-content:center;
    overflow: hidden;
}

The code above successfully centers the only child element of the body in most browsers, except IE. Can anyone explain why this issue arises specifically with Internet Explorer?

I have tested in IE 9, 10, and 11 (which appears as Edge in browser tools despite being on Windows 8.1), and found that flexbox does not work. I expected at least IE 11 to support it, but even that doesn't work. Why is this the case?

caniuse.com includes IE 11 in its list of partially supporting flexbox. The properties I've used are basic flexbox properties, so why aren't they functioning in IE 11 (which strangely appears as Edge in my IE console)? Can someone provide an explanation?

EDIT::

Here's a screenshot of what I'm observing below.

https://i.sstatic.net/YPqrm.jpg

Focus your attention towards the center right.

Answer №1

It appears that the code you've provided is functioning properly in various browsers such as IE, Safari, Chrome, and Firefox. The issue may lie within your version of Internet Explorer. You can attempt to resolve this by resetting IE to its default settings (remember to back up your data first).

https://support.microsoft.com/en-us/kb/923737

To manually open the Reset Internet Explorer Settings dialog box:

a. Close all currently open Internet Explorer and Explorer windows. b. Start Internet Explorer.

Note: If you are using Windows 8.1 or Windows 8, launch Internet Explorer from the desktop. Changes made will impact both versions. c. Go to the Tools menu and select Internet options. If you don't see the Tools menu, press Alt. d. In the Internet Options window, go to the Advanced tab. e. Click on Reset. For Windows Internet Explorer 6 users, click Restore Default.

2. In the Reset Internet Explorer Settings dialog box, click on Reset.

Note: Check the Delete personal settings box if you wish to remove browsing history, search providers, Accelerators, home pages, Tracking Protection, and ActiveX Filtering data. 3. Once default settings have been applied, click Close and then OK. 4. Exit and restart Internet Explorer.

I once encountered a similar issue where my Internet Explorer was behaving differently from others. Fortunately, I only use IE for testing purposes, so a reset didn't cause any major issues. After performing a reset, the problem was resolved. Feel free to try this solution and let me know if it resolves your issue as well.

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

What is preventing my JQuery .animate() function from functioning properly?

<head> <script type="text/javascript" src="lib/jquery-1.9.0.min.js"></script> <script type="text/javascript" src="source/jquery.fancybox.js?v=2.1.4"></script> <link rel="stylesheet" type="text/css" href="source/jque ...

Is there a way to automatically shorten a text when it goes beyond the boundaries of a div container?

How can I prevent a paragraph in one of two adjacent div containers from having a line break without changing the container's size? The surrounding div uses display: flex to position its children side by side. Currently, I've applied the followin ...

Using jQuery and AJAX to dynamically pass a variable into the URL parameter in dynamic HTML pages

By utilizing jQuery, I am dynamically updating the content of a div with a form that consists of two textboxes and a button. Upon clicking this button, ajax is employed to retrieve results from a public webservice based on the data gathered from the textbo ...

What could be causing my bootstrap dropdown button to malfunction?

Even after selecting an option from the dropdown menu and pressing the button, the value does not change. I attempted to console log it using JavaScript but encountered an error in the Chrome inspector: index.js:26 Uncaught TypeError: Cannot read prop ...

Completing a submission on a bootstrap form, using innerHTML and displaying an alert

I am currently having an issue with navigating to the home page after submitting a form in Bootstrap. Although I have successfully implemented an alert message upon submission, the page does not redirect to the home page as expected. Instead, it redirects ...

What is the best way to center a rotated element and have it aligned to the top?

* { box-sizing: border-box; } body { font-family: 'Poppins', sans-serif; margin: 0px; } .we-adopt { background-color: #8a8484; color: #ffffff; padding: 88px 0px; height: 100px; } .we-adopt-list span { display: i ...

Two tables arranged in a nested grid layout

Picture a bootstrap grid setup with an 8:4 layout. <div class="container"> <div class="row"> <div class="col-md-8"> </div> <div class="col-md-4"> </div> </div> </div> ...

The Move-class only applies to items within a transition-group that have not been removed if other items were removed

My item list is displayed in a flex-box, forming a matrix with several rows and items per row. I use the <transition-group class="move"> to apply a simple move transition to the <div v-for="item in items" :key="item.id"> move { transition: t ...

The style of a button element is lost when hovering over it after the background color has

This question is related to CSS. If you look at this example, you will see a button with two span elements inside. One using float:left; and the other using float:right;. The button has a typical button-style, but when clicked on an iPhone or hovered over ...

Conceal default video player controls in Google Chrome

I have a dilemma with hiding the default play button in the center of my video. Even though I have a custom play button, the native play button is still showing underneath it on tablets and mobile devices. Unfortunately, I am unable to access the CSS for i ...

The Google calendar integration is working, but the appearance leaves much to

I embedded a Google calendar, but I'm having trouble centering it on the page without it overflowing onto the top menu. Can you help me fix this issue? If you'd like to see what I'm referring to, you can visit this link: ...

Optimal method for integrating Google Font in GWT application

After successfully installing the Roboto font on my machine, I proceeded to include it in my welcome.html file by adding the following code: <link href='http://fonts.googleapis.com/css?family=Roboto:regular,medium,bold,thin' rel='stylesh ...

Element width shrinks inside container query

Can you explain why using container-type: inline-size renders the span normally but collapses the button? <span style="container-type: inline-size; outline: 1px solid blue;"> This is a span </span> <button style="container-type: inli ...

SyntaxError: An unidentified item was encountered at the <head> location

I have encountered an issue while loading a PHP file that utilizes ajax. Initially, the page loads without any errors. However, upon triggering the onclick event on a button, I receive the error message "Uncaught SyntaxError: Unexpected identifier" pointin ...

What is the best way to position my two icons next to each other in the footer of my React application?

I'm struggling with styling the footer of my react portfolio project. I specifically want to include Github and LinkedIn icons side-by-side at the bottom of the screen, but currently, they are stacked vertically in the middle of the page with too much ...

Is it possible to create a webpage where the header and footer remain static, while the content in the body can be dynamically changed

I am in the process of creating a webpage where main.html will load a page with a static header and footer that remains unchanged when navigation links are clicked. I'd like to achieve this using Javascript, with the body content being sourced from an ...

What's causing the appearance of a horizontal scrollbar?

I'm puzzled by the appearance of a horizontal scroll bar on my webpage and I can't seem to pinpoint the exact cause. I've tried simplifying the page as much as possible, but there still seems to be an issue. Here's all the information I ...

Update a JQuery function for an input field following an innerHTML command

Using JQuery to check the file size and name from an html file input field can be a useful tool. The input field in question looks like this: <div id="uploadFile_div"> <input name="source" id="imageFile" type="file" style ="border: 1px solid ...

What could be causing the append function to only work during the final iteration of my code?

I find myself in the position of recreating a table based on another existing one. While I am aware that this may not be the ideal approach, it is a task that has been assigned to me rather than being my own choice. My method involves iterating through ea ...

Stop the color buffer from being automatically cleared in WebGL

Removing gl.clearColor(c[0],c[1],c[2],1.0); gl.clear(gl.COLOR_BUFFER_BIT ); does not stop the screen from getting cleared at the start of the next draw cycle. Is there a method to avoid this situation? I am aiming for an overpaint effect. ...