Using IE10’s Legacy Flexbox for Responsive Layouts
IE10 supports a prefixed version of Flexbox. Learn how to target it, build fluid columns, and handle its quirks with a real‑world example and feature‑detection fallback.
11 Feb 2026, 05:39 UTC

Problem: Responsive UI in an IE10‑only Intranet
Many internal web apps still run on Windows 7 and Internet Explorer 10. Traditional float‑based layouts are verbose, brittle, and hard to keep equal‑height. Without JavaScript, developers look for a CSS‑only solution that works in IE10 and can be gracefully degraded in older browsers.
Thesis: Leverage the prefixed Flexbox API with Feature Detection
IE10 implements the 2012 working draft of the CSS Flexible Box Layout module, exposed through the -ms- prefix. By detecting support and applying display: -ms-flexbox only when available, you get fluid, equal‑height columns and dynamic spacing without extra scripts.
1. What IE10 Flexbox Looks Like
IE10’s implementation follows the older draft:
- All main properties are prefixed:
display: -ms-flexbox,-ms-flex-direction,-ms-flex-pack,-ms-flex-align. - The
flexshorthand is missing; you must set-ms-flexon items if you need flex grow/shrink. - There is no
flex-wrap; multi‑row layouts require nested containers. - Values differ slightly from the modern spec:
-ms-flex-pack: justifyis equivalent tojustify-content: space-betweenin the current spec.
2. Worked Example: A Responsive Card Grid
Here’s a minimal grid that works in IE10 and falls back to floats for IE9 and earlier.
// CSS
/* Fallback for old browsers */
.card-container {
float: left;
width: 48%;
margin: 1%;
}
/* IE10 Flexbox */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.card-container {
float: none; /* reset float */
display: -ms-flexbox;
-ms-flex-direction: row;
-ms-flex-pack: justify;
-ms-flex-align: stretch;
width: 100%;
}
.card {
-ms-flex: 1 1 0%; /* grow, shrink, basis */
margin: 0 1%;
}
}
/* HTML */
<div class="card-container">
<div class="card">Card 1</div>
<div class="card">Card 2</div>
<div class="card">Card 3</div>
</div>
Explanation:
- The
@mediaquery targets IE10’s “high‑contrast” media feature, which is the only reliable way to isolate IE10 from other browsers. - Inside the block,
display: -ms-flexboxturns the container into a flex container. - Each card receives
-ms-flex: 1 1 0%to grow and shrink equally. - Because
flex-wrapis absent, the grid stays single‑row; add a second container if you need multiple rows.
3. Trade‑offs & Limitations
- No wrapping: IE10 can’t wrap flex items, so you must nest containers for multi‑row layouts.
- Prefix overload: All properties need the
-ms-prefix, increasing CSS size and maintenance effort. - Missing features: Modern flexbox conveniences like
gapororderare unavailable; you’ll need extra markup or JavaScript for those. - Known bugs: Inline‑flex elements can overflow, and percentage
flex-basismay misbehave when the parent has a fixed height. - Future‑proofing: Newer browsers ignore the prefixed properties; ensure your fallback remains valid.
4. Verify Support in IE10
- Open the page in IE10 and press F12 to launch Developer Tools.
- Navigate to the Computed tab for the container element.
- Confirm the
displayvalue reads-ms-flexboxand that child elements show computed-ms-flexvalues. - Run a quick feature‑detect snippet in the console:
if ('msFlexBox' in document.documentElement.style) { console.log('Flexbox supported'); } else { console.log('Fallback needed'); } - Optionally, add a tiny
console.loginside the@mediablock to ensure the CSS rule is applied.
Actionable Closing
To adopt IE10 Flexbox in your intranet:
- Wrap your flex containers in a conditional
@mediaquery that targets-ms-high-contrast. - Use the prefixed properties exactly as shown; avoid shorthand and unprefixed values.
- Provide a float‑based fallback for IE9 and earlier.
- Test in IE10’s F12 tools and verify computed styles.
- Document the known bugs and plan a migration path to modern Flexbox once your user base moves to newer browsers.
By following this pattern, you can deliver clean, responsive UI components in IE10 while keeping the codebase maintainable and future‑ready.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.