【问题标题】:CSS styled button not appearing in IE8, works fine in other browsersIE8 中没有出现 CSS 样式的按钮,在其他浏览器中工作正常
【发布时间】:2014-07-09 09:45:57
【问题描述】:

有人可以看看下面的代码并帮助我吗?这些是带有渐变的 CSS 样式按钮的文本链接,在 Chrome、Safari、Firefox 等中显示良好。不幸的是,我还需要在 IE8 中使用它。我确实尝试过 PIE,但没有帮助。

感谢您查看此内容..

编辑:粘贴错误代码

CSS

.home-links {
  margin-top: -1px;
  margin-bottom: 45px;
  padding-bottom: 0px;
  padding-left: 0px;
  border: 3px solid #275da6;
  border-radius: 21px;
  background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.49) 6%, rgba(176, 192,     213, 0.29) 45%, rgba(10, 60, 125, 0.6) 87%);
  background-image: -o-linear-gradient(rgba(255, 255, 255, 0.49) 6%, rgba(176, 192, 213, 0.29) 45%, rgba(10, 60, 125, 0.6) 87%);
  background-image: linear-gradient(rgba(255, 255, 255, 0.49) 6%, rgba(176, 192, 213, 0.29) 45%, rgba(10, 60, 125, 0.6) 87%);
  background-size: auto;
}

.link-text {
  margin-top: 27px;
  margin-bottom: 26px;
  font-family:'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  color: #bbd7fc;
  font-size: 16px;
  text-align: center;

 }

【问题讨论】:

  • 您将 ie8 用于一件事。我会尝试更改班级的名称。
  • 我知道,这是客户的委托。必须在 IE8 中完全正常运行。喂。
  • 我无法检查 IE。试试display:inline-block
  • 渐变的声明在哪里? IE8 实际上在做什么?你有可以包含的 jsFiddle 或屏幕截图吗?
  • @durbnpoisn 如果单位值为 0,则无需指定度量单位。

标签: html css internet-explorer-8


【解决方案1】:

Bootstrap 2.x 通过专有的 Gradient Filter 在 IE8 中完成渐变。例如,这是默认按钮 (.btn) 样式的过滤规则:

filter: progid:DXImageTransform.Microsoft.gradient(
    startColorstr='#ffffffff', 
    endColorstr='#ffe6e6e6', 
    GradientType=0);

不过,IE8 不支持 rgba 颜色,因此您必须接受与等效十六进制颜色的近似值。

【讨论】:

    猜你喜欢
    • 2011-08-14
    • 1970-01-01
    • 2015-08-26
    • 1970-01-01
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 1970-01-01
    • 2012-06-18
    相关资源
    最近更新 更多