如何指定IE 11特定的css文件? [英] How do I specify IE 11 specific css file?

查看:100
本文介绍了如何指定IE 11特定的css文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个页面,当用户使用下面的html语法单击打印按钮时,我正在应用某些浏览器特定的CSS样式。但是下面的html代码不会应用为IE11指定的css(ie11print.css),而是应用为其余IE版本(ieprint.css)指定的css。

 <! -  [if IE 11]> < link rel =stylesheetmedia =printtitle =Printtype =text / csshref =/ styles / ie11print.css/><![endif]  - > 
<! - [if lte IE 10]> < link rel =stylesheetmedia =printtitle =Printtype =text / csshref =/ styles / ieprint.css/><![endif] - >
<! - [if!IE]> - >< link rel =stylesheetmedia =printtitle =Printtype =text / csshref =/ styles /print.css/><! - <![endif] - >

有谁知道如何为IE11指定一个CSS文件?
在此先感谢。

解决方案

使用下面的hack并跟着您的css风格:

  * ::  -  ms-backdrop,

示例:

  * ::  -  ms-backdrop,/ *您的元素* / {
/ *您的风格* /
}

注意:它只会影响IE浏览器。所以你需要在此之前应用你的正常风格。

I currently have a page for which I am applying some browser specific CSS styling when user clicks print button using the following html syntax. But the following html code wont apply the css specified for IE11(ie11print.css) instead it applies the css that is specified for rest of the IE versions(ieprint.css).

<!--[if IE 11]> <link rel="stylesheet" media="print" title="Print" type="text/css" href="/styles/ie11print.css" /><![endif]-->
<!--[if lte IE 10]> <link rel="stylesheet" media="print" title="Print" type="text/css" href="/styles/ieprint.css" /><![endif]-->
<!--[if !IE]>--><link rel="stylesheet" media="print" title="Print" type="text/css" href="/styles/print.css" /><!--<![endif]-->

Does anybody know how to specify a CSS file only for IE11? Thanks in advance.

解决方案

Use the below hack and followed by your css style:

*::-ms-backdrop,

Example:

*::-ms-backdrop,/*Your element*/ {
       /*Your styles*/
    }

Note:It will only affects in IE browsers.So You need to apply your normal style before this.

这篇关于如何指定IE 11特定的css文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆