Troubleshooting issues with the IE flexible box model functionality

Working on incorporating the flexible box model into my website has been a bit challenging. It seems to function well in webkit-based browsers like Chrome and Safari, but I'm running into issues with Mozilla, Opera, and most notably Internet Explorer. Despite defining the necessary properties including -ms-box-.. alongside others in my CSS stylesheet for the .holder class and #new_div id, IE just won't cooperate. Here's a snippet of the code:

.holder
{
    width:100%;
    margin:auto;
    display:-webkit-box;
    display:-o-box;
    display:-ms-box;
    display:-box;
    display:-pie;
    -webkit-box-orient:vertical;
    -moz-box-orient:vertical;
    -o-box-orient:vertical;
    -ms-box-orient:vertical;
    -box-orient:vertical;
    -pie-box-orient:vertical;
    -moz-box-flex:1;    
    -o-box-flex:1;      
    -ms-box-flex:1;     
    -box-flex:1;        
    -pie-box-flex:1;
    -webkit-box-flex:1;
    -webkit-box-pack:center;
    -o-box-pack:center;
    -ms-box-pack:center;
    -pie-box-pack:center;
    -box-pack:center; 
    text-align:center;
    behavior: url(../../Content/pie/PIE.htc);
}

.holder #new_div
{
    width:940px;
}
.holder div
{
    -webkit-box-pack:center;
    -o-box-pack:center;
    -ms-box-pack:center;
    -box-pack:center; 
    -pie-box-pack:center;
    behavior: url(../../Content/pie/PIE.htc);
}

#new_div
{
    margin:auto;
    display:-webkit-box;
    display:-moz-box;
    display:-o-box;
    display:-ms-box;
    display:-box;
    display:-pie-box;
    text-align:left;
    -webkit-box-flex:1;
    -moz-box-flex:1;   
    -o-box-flex:1;     
    -ms-box-flex:1;    
    -box-flex:1; 
    -pie-box:1;     
    -webkit-box-pack:center;
    -box-pack:center;
    -moz-box-pack:center;
    -o-box-pack:center;
    -ms-box-pack:center; 
    -pie-box-pack:center;
    background-color:#25282D;
    -webkit-box-orient:horizontal;
    -moz-box-orient:horizontal;
    -o-box-orient:horizontal;
    -ms-box-orient:horizontal;
    -box-orient:horizontal;
    -pie-box-orient:horizontal;
    min-width:940px; 
    padding:20px;
    behavior: url(../../Content/pie/PIE.htc);
}

I've explored solutions like using the CSS3Pie library and even attempting to install chrome plugins for IE, but nothing seems to work. Could there be a syntax error in my existing CSS causing this issue specifically in Internet Explorer? Any ideas or suggestions would be greatly appreciated!

Answer №1

In Internet Explorer (IE), the Flexbox properties used are not the deprecated ones from 2009, but rather those from the March 2012 draft. Opera, on the other hand, supports the standard Flexbox properties without prefixes and utilizes the 2009 properties under the -webkit- prefix.

.holder {
  width: 100%;
  margin: auto;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  text-align: center;
}

.holder #new_div {
  width: 940px;
}

.holder div {
  /* justify-content does nothing here since this element isn't a flex container */
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
}

#new_div {
  margin: auto;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  text-align: left;
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  /* this shouldn't be necessary, as the default direction is `row` */
  -webkit-box-orient: horizontal;
  -moz-box-orient: horizontal;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  min-width: 940px;
  padding: 20px;
}

It's important to note that IE version 10 or higher is required for this implementation

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

Achieving a layout of three columns and two rows (1 x 2 x 2) using flexbox

I am looking to achieve a specific layout using Flexbox. While I am comfortable with CSS, I want to challenge myself by learning how to implement this design using Flexbox for more concise and maintainable code. https://i.stack.imgur.com/QDVfT.png .ban ...

Is it possible to adjust an inline CSS style upon clicking a link?

I currently have a form that is hidden using inline styling style="display: none;" Is there a way to dynamically update this style to style="display: inline;" once a specific link on the page is clicked? ...

What is the best way to expand the header, content, and footer colors to cover the entire width of a page while keeping everything centered within a fixed width

I managed to get the header and main content area to stretch across the full page, while keeping the content centered. But now I am facing an issue with the footer not stretching like the header. How can I make the footer stretch as well? HTML: <body ...

Is there a way to obtain HTML code within a contentEditable DIV?

When working in a contentEditable-DIV, my goal is to extract the HTML code from the starting position (0) to the end position where the user has clicked. <div id="MyEditableId" contentEditable="true"> 1. Some text 123. <span style="background-c ...

Troubleshooting mat-accordion title problem on mobile devices

Despite reading numerous blogs and conducting extensive searches on Google, I am still unable to resolve the CSS issue related to Angular material below. Your assistance in fixing this problem would be greatly appreciated. Desktop view: https://i.stack.im ...

Adjust the scroll position in HTML by using a fixed navbar with Bootstrap 4

I am currently working on a single-page website with multiple sections. Users can navigate to these sections either by scrolling or by clicking on the navbar links. The issue I am facing is that the Bootstrap 4 navbar is fixed to the top, causing the conte ...

On the same line, there are two divs with different characteristics - one dynamically changing width and the

I am facing an issue with arranging two divs under one parent div. The parent div is set to have a width of 100%: <div id="parent"> <div class="left"></div> <div class="right"></div> </div> The specific conditions ...

Content within this specific div should move in a marquee fashion

#player #title{ left: 90px; width: 200px; overflow: hidden; } Within this specific div (#Title), the text should scroll like a marquee. The challenge is to achieve this effect using only JavaScript without altering the HTML structure. How can this be acco ...

centered table within a container with vertical alignment

I'm having trouble centering a table vertically in a div. I've tried using vertical-align but it's not working for me. Can anyone suggest a solution to place it at the top of the div? <div class="col-12 d-flex"> <div c ...

How to rename a class of an image tag using jQuery

I need to update the class name in my image tag <img src="img/nex2.jpeg" class="name"> When hovering over with jquery, I want to add a new class to it. After hovering, the tag should appear as follows: <img src="img/nex2.jpeg" class="name seco ...

The background image doesn't extend to the bottom of the page due to the inability to utilize background-attachment

Currently, I am working on a project that requires a background image to cover the entire page. Unfortunately, using "background-attachment: cover" is not an option due to the need for compatibility with iOS, which does not support this property. .sky-b ...

Using React components with Material UI to create styled div boxes

As I work on creating a mock website with React and Material UI, I have utilized the RaisedButtonExampleSimple component for buttons from Material UI within a div named App-Intro. Strangely, the text in the Div "Customer-Choice" is displaying above the but ...

Utilizing mat dialog in conjunction with the bootstrap sticky top class to enhance functionality

I am encountering an issue where, upon clicking to delete an entry, a mat dialog should appear with everything else in the background greyed out. However, the problem I am facing is that when I attempt to delete an entry, the dialog appears but the sticky ...

When resizing, the image problem does not transition to the next column

Just started learning how to code and I've been stuck on this issue for a while now. Whenever I resize the browser window, the image doesn't move down to the next line after the .text class like I want it to. Instead, it overflows off the page to ...

ScrollSpy Plugin in JQuery - Implementing automatic vertical text scrolling with dynamic height customization

I have been using this code to display the most recent user comments on my website, where some comments are concise while others are more lengthy. If you inspect the source code, you will notice that the height is set to 90px and overflow is set to hidden ...

Implementing both inset and external box shadows on the same div element

Is it possible to apply both inner and outer box shadow to the same div element? I've attempted it but it doesn't seem to be working as expected. http://jsfiddle.net/CWuw8/ div{ top: 100px; position: absolute; left: 100px; hei ...

Place the Div in a consistent position on images of varying widths

I have a dilemma with my class that is supposed to display images. The issue arises when I try to place a div within an image inside this class. Everything works smoothly when the image takes up the entire width of the class, but as soon as the image widt ...

"Customizable rectangular container with jagged edges created with Scalable Vector Graphics

Currently, I am undertaking a small project that involves creating a box with rough edges around some text. To achieve this effect, I am utilizing an SVG with unique edges similar to the design found at this link: (except mine is in SVG format). My goal ...

What is the process for updating the background image in Ionic?

Currently facing an issue with setting an image for background in Ionic. The code provided doesn't seem to be working as expected. It appears that the style sheet is not being applied correctly. Not sure where exactly to add the style sheet or how to ...

Using an HTML element to pass a variable into a replace function

I am looking to highlight a 'SearchString' by replacing it with <span style="background-color: yellow">SearchString</span> within a targetString. The SearchString varies, so I am wondering how I can make this happen. This is what I ...