English 中文(简体)
当调用几个值时,一些混混参数保持不变
原标题:Some mixin parameters remain unchanged when called with several values

我有一个 < code>. less 样式表,该样式表对自定义梯度具有混合特性。 当我用它创建几个梯度时, 所有其他浏览器的规则都很好, 但旧 IE 浏览器的 < code> 过滤器 规则在第一次调用后没有变化 。

以下是一个脱衣的例子,我设法将我的问题复制为:

.myGradient(@bg: rbg(255,255,255), @start: #FFFFFF, @end: #E6E6E6) {
        background: @start;
        background: -webkit-linear-gradient(top, @start 0%,@end 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=@start, endColorstr=@end,GradientType=0 );
}

.one {
        .myGradient(#ffa201,#ffa201,#ff7301);
}

.two {
        .myGradient(#aaaaaa,#aaaaaa,#cccccc);
}

.three {
        .myGradient(#ffffff,#ffffff,#000000);
}

以下是由 lessc 1.3.0 生成的 CSS :

.one {
  background: #ffa201;
  background: -webkit-linear-gradient(top, #ffa201 0%, #ff7301 100%);
  filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffa201, endColorstr=#ff7301, GradientType=0);
}
.two {
  background: #aaaaaa;
  background: -webkit-linear-gradient(top, #aaaaaa 0%, #cccccc 100%);
  filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffa201, endColorstr=#ff7301, GradientType=0);
}
.three {
  background: #ffffff;
  background: -webkit-linear-gradient(top, #ffffff 0%, #000000 100%);
  filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffa201, endColorstr=#ff7301, GradientType=0);
}

如你所见,网基梯度和预期的一样有效,但是IE总是保持橙色。有什么不对吗?

最佳回答

尝试 :

filter: e(%("progid:DXImageTransform.Microsoft.Gradient(StartColorStr= %d , EndColorStr= %d , GradientType=0)",@start,@end));
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签