Asked
Active
Viewed 1,045 times
3

I'm having an issue getting the CSS grid to work. As far as I know, I am following the spec for the IE10/11 specification for this. My initial research led me to: CSS Grid Layout not working in Edge and IE 11 even with -ms prefix - and tried implementing suggested changes.

my code is below:

.filter-item-grid {
 display: grid;
 display: -ms-grid;
  grid-template-columns: auto auto;
  -ms-grid-columns: 267px 267px;
  -ms-grid-rows: 1fr;
}
<div class="filter-item-grid">
  <div class="letter-list__filter-item">
      <h3 class="letter-list__filter-title">
        <a href="#">Headline</a>
      </h3>
      <p>Sub headline</p>
   </div>
   <div class="letter-list__filter-item">
      <h3 class="letter-list__filter-title">
        <a href="#">Headline</a>
      </h3>
      <p>Sub headline</p>
    </div>
    <div class="letter-list__filter-item">
      <h3 class="letter-list__filter-title">
        <a href="#">Headline</a>
      </h3>
      <p>Sub headline</p>
    </div>
    <div class="letter-list__filter-item">
      <h3 class="letter-list__filter-title">
        <a href="#">Headline</a>
      </h3>
      <p>Sub headline</p>
    </div>
</div>

When viewing this markup in IE, it looks as if everything is absolutely positioned in the same spot. As per the attached answer I'm:

  1. Using vendor prefixes
  2. not relying on auto for the MS fallback
  3. Not using repeat()
  4. explicitly stating position of each item.

What specifically needs to change to fully support the IE specification for CSS grid? Or is it reccomended to use the @supports CSS query?

TylerH
  • 20,799
  • 66
  • 75
  • 101
kawnah
  • 3,204
  • 8
  • 53
  • 103

1 Answers1

1

Changing the display setting to display: grid -ms-grid; and adding the new class to each makes it not collapse see snippet: Tested in IE11 and Chrome v67.0.3396.99.

.filter-item-grid {
  display: grid -ms-grid;
  -webkit-column-count: 2;
  -moz-column-count: 2;
  column-count: 2; 
}
.new{
vertical-align: top;
padding-top:10px;
margin:0;
}
<div class="filter-item-grid">
  <div class="letter-list__filter-item new">
    <h3 class="letter-list__filter-title new">
      <a href="#">Headline</a>
    </h3>
    <p>Sub headline</p>
  </div>
  <div class="letter-list__filter-item new">
    <h3 class="letter-list__filter-title new">
      <a href="#">Headline</a>
    </h3>
    <p>Sub headline</p>
  </div>
  <div class="letter-list__filter-item new">
    <h3 class="letter-list__filter-title new">
      <a href="#">Headline</a>
    </h3>
    <p>Sub headline</p>
  </div>
  <div class="letter-list__filter-item new">
    <h3 class="letter-list__filter-title new">
      <a href="#">Headline</a>
    </h3>
    <p>Sub headline</p>
  </div>
</div>
Scath
  • 3,777
  • 10
  • 29
  • 40