0

我有这个CSS类:

.defaultActionButton {
height: auto;
padding-top: 5px;
padding-bottom: 6px;
padding-left: 10px;
padding-right: 10px;
white-space: normal;
border: 1px solid #3079ed;
border-radious: 2px;
font-size: 13px;
color: white;
font-weight: bold;
text-align: center;

background: #4d90fe; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzRkOTBmZSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM0ZDg3ZWQiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top,  #4d90fe 0%, #4d87ed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4d90fe), color-stop(100%,#4d87ed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #4d90fe 0%,#4d87ed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #4d90fe 0%,#4d87ed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #4d90fe 0%,#4d87ed 100%); /* IE10+ */
background: linear-gradient(to bottom,  #4d90fe 0%,#4d87ed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4d90fe', endColorstr='#4d87ed',GradientType=0 ); /* IE6-8 */
<!--[if gte IE 9]>
filter: none;
<![endif]-->
}

此类由 GWT CssResource 加载:

interface Common extends CssResource {
            //cut
    String defaultActionButton();
            //cut
}

应用此行:

loginButton.addStyleName(Styles.INSTANCE.common().defaultActionButton());

这适用于 Chome、Firefox 和 IE9: 风格还行 但在 IE8 中不应用这种样式并且按钮很难看:风格柯

(IE8 不支持border-radius,但这不是问题)。

顺便说一句,将 css 样式类复制到仅包含一个简单按钮的纯 HTML 文件中,IE8 也可以很好地显示它:样式OkIE8simpleHtml

我怎样才能在“内部”GWT 中获得相同的结果?

提前致谢

4

1 回答 1

0

我在我的项目中做到了,它在 IE8 中工作。您必须在 CSS 中编写以下行。

border-collapse: separate !important;
于 2013-03-29T08:41:46.447 回答