1

在此处输入图像描述

我的边框半径和背景渐变样式没有出现在 IE8 中。IE8 中整体容器的大小也不同。

我尝试过 CSS PIE,但也没有用。

期待在此问题上获得任何帮助。请帮帮我。

提前感谢大家的提示。

.Quor_Widget_buttondescription0  //Add To Order Button
{

position:relative;
width:90%;
font-size: 24px;
height:47px;
overflow:hidden;
margin:8px 8px 5px;
border:1px solid #000000;
text-align: center;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
-moz-box-shadow:0 0 3px rgba(0,0,0,0.5);
-webkit-box-shadow:0 0 3px rgba(0,0,0,0.5);
box-shadow:0 0 3px rgba(0,0,0,0.5);
color:#000000;
font:bold, Helvetica, Arial, sans-serif;
cursor:pointer;
background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc0NjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiM2N0JBNjciIG9mZnNldD0iIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzBGQTkwRiIgb2Zmc2V0PSIiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNDYxKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(#0FA90F, #67BA67);
behavior: url(PIE.htc);

display: inline-block;

}

// 选择按钮 -- 在尺寸标签下

.segmented-button-count3 {
background: transparent;
padding: 1px;
}
.segmented-button-count3 input[type="radio"] {
width: 0px;
height: 0px;
display: none;
}
.segmented-button-count3 label {
width:33.3%;
height:20px;
padding-top: 4px;
padding-bottom: 1px;
overflow: hidden;
white-space: nowrap;
display: block;
text-overflow: ellipsis;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
vertical-align: auto;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
-ms-border-radius: 10px;
-khtml-border-radius: 10px;
border-radius: 10px;
text-shadow: white;
background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9ImczNjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjEwMCUiIHkyPSIxMDAlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZCRkJGQiIgb2Zmc2V0PSIwIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0M5QzlDOSIgb2Zmc2V0PSIxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZzM2MSkiIC8+Cjwvc3ZnPg==);
background-repeat: no-repeat;
background-size:100%; 
-webkit-box-shadow: inset 0 -4px 7px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255, 0.3), inset 0 1px 0 rgba(255,255,255, 0.3);  
-moz-box-shadow: inset 0 -8px 10px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255, 0.3), inset 0 1px 0 rgba(255,255,255, 0.3);  
box-shadow: inset 0 -8px 10px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255, 0.3), inset 0 1px 0 rgba(255,255,255, 0.3); 
background: -moz-linear-gradient(#fbfbfb, #c9c9c9);
border: 1px solid #b2b2b2;
color: 000000;
font-size: 13px;
cursor: pointer;
font-family: Helvetica;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
-o-border-radius: 0px;
-ms-border-radius: 0px;
-khtml-border-radius: 0px;
border-radius: 0px;
margin-right: -5px;
}
.segmented-button-count3 label {
*display: inline;
}
.segmented-button-count3 label:hover {
-moz-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
-o-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
color: #333333;
}
.segmented-button-count3 label:active, .segmented-button-count3 label.active {
background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9ImcyMDYiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiMyRDYyQkUiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiM2Q0E1RjUiIG9mZnNldD0iMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2cyMDYpIiAvPgo8L3N2Zz4=);
background-repeat: no-repeat;
background-size:100%; 
background: -moz-linear-gradient(#2d62be, #6ca5f5);
}
.segmented-button-count3 label.first {
-moz-border-radius-topleft: 10px;
-webkit-border-top-left-radius: 10px;
-o-border-top-left-radius: 10px;
-ms-border-top-left-radius: 10px;
-khtml-border-top-left-radius: 10px;
border-top-left-radius: 10px;
-moz-border-radius-bottomleft: 10px;
-webkit-border-bottom-left-radius: 10px;
-o-border-bottom-left-radius: 10px;
-ms-border-bottom-left-radius: 10px;
-khtml-border-bottom-left-radius: 10px;
border-bottom-left-radius: 10px;
}
.segmented-button-count3 label.last {
-moz-border-radius-topright: 10px;
-webkit-border-top-right-radius: 10px;
-o-border-top-right-radius: 10px;
-ms-border-top-right-radius: 10px;
-khtml-border-top-right-radius: 10px;
border-top-right-radius: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-border-bottom-right-radius: 10px;
-o-border-bottom-right-radius: 10px;
-ms-border-bottom-right-radius: 10px;
-khtml-border-bottom-right-radius: 10px;
border-bottom-right-radius: 10px;
}
.segmented-button-count3 input:checked + label, .segmented-button-count3 label.selected {
background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9ImcyMDYiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiMyRDYyQkUiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiM2Q0E1RjUiIG9mZnNldD0iMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2cyMDYpIiAvPgo8L3N2Zz4=);
background-repeat: no-repeat;
background-size:100%; 
background: -moz-linear-gradient(#2d62be, #6ca5f5);
}
4

3 回答 3

2

Internet Explorer 8 没有对 SVG 的本机支持。它很少或根本不支持 CSS3 属性,例如border-radius.

最好的解决方案可能是使用自定义样式(例如 JPG 背景而不是 SVG)为 IE8 制作单独的样式表,并仅在 IE8 中显示。

您还应该看看Modernizr

或者,强制用户使用真正的网络浏览器;-)

于 2013-02-22T08:15:11.013 回答
1

答:在IE6-9中实现border-radius、box-shadow和渐变背景,可以使用CSS3 PIE 。正如 SDC 所提到的,您可能希望确保 PIE.htc 文件实际上正在加载。一个例子:

.button {
  -webkit-border-radius: 12px;
     -moz-border-radius: 12px;
          border-radius: 12px;

  -webkit-box-shadow: #888 5px 5px 5px;
     -moz-box-shadow: #888 5px 5px 5px;
          box-shadow: #888 5px 5px 5px;

  background: #444; /* Single-color fallback */
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(#444), to(#CCC)); /* Chrome, Safari 4+ */
  background: -webkit-linear-gradient(#444, #CCC); /* Chrome 10+, Safari 5.1+ */
  background: -moz-linear-gradient(#444, #CCC); /* FF 3.6+ */
  background: -ms-linear-gradient(#444, #CCC); /* IE10+ */
  background: -o-linear-gradient(#444, #CCC); /* Opera 11.10+ */
  background: linear-gradient(#444, #CCC); /* W3C */

  -pie-background: linear-gradient(#444, #CCC); /* For CSS3 PIE */
  behavior: url(PIE.htc); /* Also for CSS3 PIE */
}

最佳实践:您可能需要考虑重新编写 CSS。有很多重复和不必要的属性和技巧可以使代码在特定的浏览器中工作。开始跨浏览器保持一致性的一种简单方法是使用 CSS 重置,例如Normalize.css

于 2013-02-22T10:31:19.040 回答
1

从截图中可以清楚地看出 CSS3Pie 根本没有运行。我建议阅读 CSS3Pie 网站上列出的常见问题和已知问题;看起来你可能正在与其中之一发生冲突。

特别是,您应该检查 PIE.htc 文件是否正在加载,以及是否使用正确的 mime 类型提供服务。(查看 IE8 的开发工具窗口以查看加载了哪些 URL)

第一点——如果文件根本没有被加载,它可能加载了错误的 URL。给 htc 文件的相对 URL 时,IE 可能会出错;将其更改为绝对 URL 是个好主意;例如/PIE.htc,而不仅仅是PIE.htc. 这在已知问题页面中进行了讨论。

第二点也在已知问题页面上进行了讨论。某些 Web 服务器可能无法提供具有正确 mime 类型的 htc 文件。如果不作为text/x-component. 检查下载文件时发送的 http 标头。

于 2013-02-22T10:48:23.393 回答