当我尝试在IE中使用渐变和边框半径来设置按钮的样式时,我发现由于渐变应用于背景,所以角实际上是方形的。
所有其他浏览器似乎都能够毫无问题地处理这个问题。
如果您在 FireFox 中打开它,我已经在这里演示了这 一点,例如,如果您在 Internet Explorer 中打开它,您会看到圆角和包含在边框内的渐变。
显然我夸大了半径等以使效果清晰。使用以下 CSS:
.form_Wrapper{
width: 250px;
height: 250px;
background-color: #32b1d2;
}
.form_Submit{
/*positioning*/
position: absolute;
top: 100px;
margin-left: 16px;
margin-top:20px;
padding: 3px 10px;
width: 90px;height:40px;
/*background*/
background: #808080;
background: -webkit-gradient(linear, left top, left bottom, from(#a5a5a5), to(#808080));
background: -webkit-linear-gradient(top, #a5a5a5, #808080);
background: -moz-linear-gradient(top, #a5a5a5, #808080);
background: -ms-linear-gradient(#a5a5a5, #808080);
background: -o-linear-gradient(#a5a5a5, #808080);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#a5a5a5', endColorstr='#808080');
zoom: 1;
/*border*/
border: 2px solid #a5a5a5;
border-color: #a2a2a2;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
/*text*/
opacity: 1.0;
color: #fff;
}
将渐变应用于边框内的区域而不是包含背景必须有一些技巧。但我一直无法研究解决这个问题。