Implementing Legacy CSS Grid Layouts for Internet Explorer 10
Learn how to implement CSS Grid in Internet Explorer 10 using the -ms- prefix. This guide covers the requirement for explicit item placement and provides a strategy for legacy intranet layouts.
11 Jan 2026, 01:08 UTC

The Problem: Missing Auto-Placement in IE10 Grid
Maintaining legacy line-of-business applications pinned to Internet Explorer 10 (IE10) requires a specific approach to layout. While IE10 was the first browser to implement CSS Grid, it uses a 2011 draft specification that differs fundamentally from the modern W3C standard. The most critical difference is the lack of auto-placement.
In modern browsers, adding an element to a grid container automatically places it in the next available cell. In IE10, any element without an explicit coordinate assignment will stack on top of other elements in the first cell (row 1, column 1). To achieve a functional layout, every single grid item must be manually mapped to a row and column.
Prerequisites
- A target environment running IE10 (typically a dedicated VM image for legacy support).
- A CSS preprocessor (Sass/Less) or a build tool capable of adding
-ms-prefixes. - A baseline layout using floats or
display: inline-blockto serve as a fallback for non-grid browsers.
Implementation Procedure
1. Define the Grid Container
Use the -ms-grid prefix. Unlike modern CSS, you cannot use grid-template-areas or gap. You must define the exact number of columns and rows using -ms-grid-columns and -ms-grid-rows.
/* The Container */
.main-layout {
display: -ms-grid;
-ms-grid-columns: 200px 1fr;
-ms-grid-rows: auto 1fr auto;
}
2. Explicitly Position Every Item
Because IE10 ignores the implicit grid, you must assign -ms-grid-column and -ms-grid-row to every child. Note that these values are 1-indexed.
/* Header: Spans both columns, Row 1 */
.header {
-ms-grid-column: 1;
-ms-grid-row: 1;
-ms-grid-column-span: 2;
}
/* Sidebar: Column 1, Row 2 */
.sidebar {
-ms-grid-column: 1;
-ms-grid-row: 2;
}
/* Content: Column 2, Row 2 */
.content {
-ms-grid-column: 2;
-ms-grid-row: 2;
}
/* Footer: Spans both columns, Row 3 */
.footer {
-ms-grid-column: 1;
-ms-grid-row: 3;
-ms-grid-column-span: 2;
}
3. Manage Complex Layouts via Coarse Regions
Due to the manual effort required for explicit placement, avoid using -ms-grid for small, repetitive components (like a gallery of 50 images). Instead, use the grid for coarse page regions (Header, Sidebar, Main, Footer) and use traditional floats or inline-blocks for the content inside those regions.
Comparison: Modern Grid vs. IE10 Grid
| Feature | Modern CSS Grid | IE10 (-ms-grid) |
|---|---|---|
| Placement | Automatic (Implicit) | Manual (Explicit Only) |
| Gap/Gutter | gap / grid-gap |
Not supported (use margins) |
| Areas | grid-template-areas |
Not supported |
| Repeaters | repeat(auto-fill, ...) |
Basic fr units only |
Verification and Diagnostics
To verify the layout is functioning correctly in IE10:
- Inspect via F12 Tools: Open the page in IE10 and use the developer tools to ensure the
-ms-grid-columnand-ms-grid-rowproperties are being applied and are not being overridden by other styles. - The "Stack Test": Temporarily remove the
-ms-grid-columnassignment from one element. If the element jumps to the top-left of the container and overlaps other content, the explicit placement is working as intended. - Fallback Check: Disable CSS Grid in the browser or remove the
-ms-griddeclaration. Confirm that the float-based fallback provides a usable, albeit simpler, layout.
Rollback and Recovery
If the grid layout causes rendering instability (such as percentage-width tracks collapsing), revert the container to a standard block layout and use a float-based system:
/* Rollback to float-based layout */
.main-layout {
display: block !important;
}
.sidebar {
float: left;
width: 200px;
}
.content {
float: right;
width: calc(100% - 200px);
}
.footer {
clear: both;
}
Limitations
IE10 does not support @supports, meaning you cannot use feature queries to apply these styles. You must either serve the -ms- prefixed styles to all users (which modern browsers will ignore) or use User-Agent sniffing via a library like Modernizr to apply a specific legacy CSS file.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.