IE9 round corners and filter: progid:DXImageTransform.Microsoft.gradient

戏子无情 提交于 2019-12-05 01:55:14

I'd recommend (to everyone ever!) using Paul Irish's technique which looks like this:

<!--[if lt IE 7 ]> <body class="ie6"> <![endif]--> 
<!--[if IE 7 ]>    <body class="ie7"> <![endif]--> 
<!--[if IE 8 ]>    <body class="ie8"> <![endif]--> 
<!--[if IE 9 ]>    <body class="ie9"> <![endif]--> 
<!--[if gt IE 9]>  <body> <![endif]-->
<!--[if !IE]><!--> <body> <!--<![endif]-->

in your HTML.

Then in your CSS you can write things like:

#someID {
    color:lawngreen;
}

.ie6 #someID {
    color:lightgoldenrodyellow;
}

.ie8 #someID, .ie9 #someID {
    color:saddlebrown;
}

to target different IEs. It's an easy technique that solves a lot of problems (no extra HTTP requests, an negligible extra code for all browsers).

commonpike

I lost my corners’ radius once I applied filter: progid:DXImageTransform Microsoft.gradient.... I suppose it’s a similar problem.

To solve it, I used an SVG background generated here http://ie.microsoft.com/testdrive/graphics/svggradientbackgroundmaker/default.html

It’s simpler than it sounds. In CSS, it looks like

body.ie9 div.test  {
   border-radius:10px  
   background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz...

and lo, round corners and gradient.

$2c, *-pike

I find when IE is giving me issues with stuff pushing out of the round corners, I nest that inside another element...

So for example I would put the round corners and drop shadow on the outer element with the size I want and overflow: hidden; Then put the gradient on another element inside. 100% fit.

maybe not the perfect solution, but fairly simple.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!