为IE和chrome编写单独的样式

Posted 梦见一只电子羊

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了为IE和chrome编写单独的样式相关的知识,希望对你有一定的参考价值。

flex布局在IE10上不支持,为IE10编写特定的样式可以用判断navigator.userAgent 的方法

var doc = document.documentElement;  
doc.setAttribute(‘data-useragent‘, navigator.userAgent);  

css:

    html[data-useragent*=‘MSIE‘] .LoginContainer {  
      width: 350px;  
}  

 

以上是关于为IE和chrome编写单独的样式的主要内容,如果未能解决你的问题,请参考以下文章