Targeting IE 11 in css not working

前端 未结 2 1163
既然无缘
既然无缘 2021-02-14 09:06

I\'m trying to fix a tiny layout issue in IE11 where slider pip jumps out of its place (it\'s fine in the rest of major browsers)

I\'ve added media query to stylesheet (

2条回答
  •  盖世英雄少女心
    2021-02-14 09:41

    Try using just (-ms-high-contrast: none) like this:

    @media screen and (-ms-high-contrast: none) {
      #yardstick-text-6-1 {
        margin-top: -43px;
      }
      #yardstick6-1 {
        margin-top: -53px;
      }
    }
    

    or :-ms-fullscreen,:root .selector:

    _:-ms-fullscreen,
    :root #yardstick-text-6-1.ie11 {
      margin-top: -43px;
    }
    _:-ms-fullscreen,
    :root #yardstick-6-1.ie11 {
      margin-top: -53px;
    }
    

    See BrowserHacks for IE

    Note: To fix easily you can remove float:left from #yardstick6

提交回复
热议问题