简体   繁体   English

Internet Explorer -ms-filter多次应用

[英]Internet Explorer -ms-filter applied multiple times

Trying to replicate answer to question: Not skewed text in skewed class button 尝试复制问题的答案: 倾斜的类按钮中没有倾斜的文本

The code for the answer is provided at: http://jsbin.com/obusoy/6/edit 答案的代码位于: http : //jsbin.com/obusoy/6/edit

My problem is that my solution must work in IE8, so I must use -ms-filter instead of the more friendly skew function in CSS3. 我的问题是我的解决方案必须在IE8中工作,所以我必须使用-ms-filter而不是CSS3中更友好的偏斜函数。

I obtained values for the transform from http://www.useragentman.com/IETransformsTranslator/ 我从http://www.useragentman.com/IETransformsTranslator/获得了转换的值

My CSS is: 我的CSS是:

.button-wrapper {
  background: #fff;
  border: 1px solid #bbb;
  border-color: #ddd #ccc #bbb;
  overflow: hidden;
  width:             120px;
  height:            40px;

  -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.8152074690959046, M12=-0.6840402866513375, M21=-3.885780586188048e-16, M22=1.0641777724759122, SizingMethod='auto expand')";
  margin-left: -6px;
  margin-top: -4px;

/*
FORMULA IN TRANSLATER: skew(-20deg) rotate(20deg)
EQUIVALENT OF:
  -webkit-transform: skewX(-20deg);
  -moz-transform: skewX(-20deg);
  -o-transform: skewX(-20deg);
  transform: skewX(-20deg);
*/

}

.button-wrapper:hover {
  background: #efe;
  border-color: #090;
}

.button-wrapper button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  padding: 4px 0;
  margin: 0;
  width: 100%;

  -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.8152074690959046, M12=0.6840402866513375, M21=-3.885780586188048e-16, M22=1.064177772475912, SizingMethod='auto expand')";

/*
FORMULA IN TRANSLATER: skew(20deg) rotate(-20deg)
EQUIVALENT OF:
  -webkit-transform: skewX(20deg);
  -moz-transform: skewX(20deg);
  -o-transform: skewX(20deg);
  transform: skewX(20deg);
*/    
}

.button-wrapper button:hover {
  color: #060;
}

My HTML is: 我的HTML是:

<div class="button-wrapper">
  <button id="RefreshButton3" runat="server" ServerClick="RefreshButton_Click">Refresh</button>
</div>

My problem is the text is not quite skewed back to the original amount (looks compressed horizontally and still slightly italic). 我的问题是文本没有完全偏斜到原始数量(看起来水平压缩并且仍然略斜)。

What are the correct transform values to use? 正确使用哪些转换值? What step am i missing? 我想走哪一步?

UPDATE: Solution found. 更新:找到解决方案。 Problem was the order of operation matters. 问题是操作顺序很重要。 If the first transform is skew() rotate() then the second transform must be rotate() skew(). 如果第一个转换是skew()rotation(),则第二个转换必须是rotate()skew()。 This gives a slightly different matrix in second step of: 在第二步中,得出的矩阵略有不同:

-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1.064177772475912, M12=0.6840402866513375, M21=-3.885780586188048e-16, M22=0.8152074690959046,, SizingMethod='auto expand')";

(posting as separate answer as recommended in comment) (作为评论中建议的单独答案发布)

Problem was the order of operation matters. 问题是操作顺序很重要。 If the first transform is skew() rotate() then the second transform must be rotate() skew(). 如果第一个转换是skew()rotation(),则第二个转换必须是rotate()skew()。 This gives a slightly different matrix in second step of: 在第二步中,得出的矩阵略有不同:

-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1.064177772475912, M12=0.6840402866513375, M21=-3.885780586188048e-16, M22=0.8152074690959046,, SizingMethod='auto expand')";

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

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