简体   繁体   English

边框图像渐变在IE10中不起作用?

[英]Border Image Gradient Not Working in IE10?

I have some rules for my div "Border" It works in all other browsers but not in IE 10. Anybody have any idea why this could be happening? 我的div“边框”有一些规则,它可以在所有其他浏览器中使用,但在IE 10中不起作用。有人知道为什么会发生这种情况吗? Thank you. 谢谢。

 .border { background: white; border: 8px solid transparent; -moz-border-image: -moz-linear-gradient(top left, white 50%, #3a4ed5 100%); -webkit-border-image: -webkit-linear-gradient(top left, white 50%, #3a4ed5 100%); border-image: linear-gradient(to bottom right, white 50%, #3a4ed5 100%); border-image-slice: 1; } .border { background-color: white; display: block; height: 50px; width: 150px; text-align: center; transform: skewX(-15deg); } 
 <div class="border"> <div> 

You said that you have the meta tag set to emulate IE10. 您说您已将meta标签设置为模拟IE10。

Border images are not supported by IE10, only IE11. IE10不支持边框图像,仅IE11不支持。 (You can confirm here: http://caniuse.com/border-image/embed/ .) (您可以在此处进行确认: http : //caniuse.com/border-image/embed/ 。)

So if you set IE11 to emulate IE10, it will stop supporting border images. 因此,如果将IE11设置为模拟IE10,它将停止支持边框图像。

To resolve the problem, you need to remove the IE10 emulation. 要解决此问题,您需要删除IE10仿真。 The best thing to do here is to explicitly tell IE to use it's best available mode. 最好的做法是明确告诉IE使用它的最佳可用模式。 This can be done as follows: 可以按照以下步骤进行:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Simply swap out your existing meta tag for this one, and the border image problem will be solved. 只需将您现有的meta标签换成该标签,边框图像问题即可解决。

However, before you make that change you should check to confirm if there is any other reason why your site might have wanted to be in IE10 mode. 但是,在进行更改之前,您应该检查以确认是否还有其他原因导致您的站点可能希望处于IE10模式。 I'm guessing there isn't any reason, but it's worth checking. 我猜没有任何原因,但是值得检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM