响应式ie8兼容问题

css3的media属性在IE8及以下的版本中无法生效。

if (navigator.appName === 'Microsoft Internet Explorer') { //判断是否是IE浏览器
  if (navigator.userAgent.match(/Trident/i) && navigator.userAgent.match(/MSIE 8.0/i)) { //判断浏览器内核是否为Trident内核IE8.0
    $('#Zbody').css('top','19%')
        .css('height','57.5%');
    $('#lunDiv>img').height($('#bigPh').height());
    $('.login-form1').css('margin-left','-15px');
    if (height<600) {
      $('.hexin-img').css('height','50%');
    };

  }
}

通过if判断出IE8内核,然后给IE8设定一组比较适合的样式,以此来替代@media

原文地址:https://www.cnblogs.com/webwangjie/p/7298103.html