Display table-cell on pseudo element in IE11

寵の児 提交于 2019-12-11 11:51:05

问题


Running into an interseting issue with IE11 and IE10.

I have a list using a check icon before each item.

On mobile we want the check's position to maintain next to text in that the text does not warp beneath the check.

I've executed this by using display:table-cell on the pseudo element that contains the check icon.

However, when using table-cell in IE11 it doesn't display at all. I've been able to narrow it down to that display property through testing.

I've given a height and width but nothing seems to respect the table-cell layout in IE11 or IE10.

HTML

<ol class="list-check">
    <li>Certified by the Water Quality Association</li>
    <li>Approved to NSF 42 standards</li>
    <li>Removes bad odors and flavors</li>
    <li>Reduces chlorine</li>
    <li>Made of coconut shell carbon</li>
    <li>Made of a plant-based casing</li>
    <li>Lasts 40 gallons</li>
    <li>BPA-free</li>
</ol>

CSS

.list-check { 
    text-align: left;
    list-style-type: none;

    li {
        display: table;
        margin-bottom: em(10px);
        &:before {
            content: "\e601";
            height: 25px;
            width: 25px;
            font-family: 'icons';
        }
    }
}

来源:https://stackoverflow.com/questions/29332318/display-table-cell-on-pseudo-element-in-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!