IE10,IE11中的跨浏览器CSS渐变 [英] Crossbrowser css gradient in IE10, IE11

查看:275
本文介绍了IE10,IE11中的跨浏览器CSS渐变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在所有浏览器中对深色按钮进行了渐变,除IE10和IE11版本外,它看起来都不错.顶部和底部有浅色条纹. 我通过colorzilla渐变编辑器生成渐变.

I did a gradient for dark buttons in all browsers, it appears good, except IE10, IE11 versions. Light stripe on top and bottom. I generate gradient by colorzilla gradient editor.

链接到按钮

HTML

<div class="dark-button">div button</div>


CSS


CSS

.dark-button {
background: #0874b6; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzM0ODliZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMTZjYWQiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #0874b6 0%, #016cad 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0874b6), color-stop(100%, #016cad)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #0874b6 0%, #016cad 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #0874b6 0%, #016cad 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0874b6 0%, #016cad 100%); /* IE10+ */
background: linear-gradient(to bottom, #0874b6 0%, #016cad 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0874b6', endColorstr='#016cad', GradientType=0); /* IE6-8 */
border: 1px solid #016cad;
border-radius: 3px;
color: #f1f1f1;
cursor: default;
display: inline-block;
margin: 5px;
padding: 6px 9px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);

}

我该如何解决?

推荐答案

我用它们来完成我想要的白色到浅红色的自上而下的工作. 经过测试: Windows 8.1中的FireFox 33.0.3 Windows 8.1中的IE 11.0.13 Windows 8.1中的Opera 25 Windows 8.1中的Chrome 38 OS X 10.10(Yosemite)中的Safari 8.0 OS X 10.10(Yosemite)中的Firefox 26.0

I used these they do what I want white to a pale red top to bottom. Tested with: FireFox 33.0.3 in Windows 8.1 IE 11.0.13 in Windows 8.1 Opera 25 in Windows 8.1 Chrome 38 in Windows 8.1 Safari 8.0 in OS X 10.10 (Yosemite) Firefox 26.0 in OS X 10.10 (Yosemite)

background: #ffffff; 
background: -webkit-linear-gradient(bottom, #d85570, white); /* For Safari 5.1 to 6.0 */
background: -moz-linear-gradient(top, white, #d85570); /* For Firefox 3.6 to 15 */
background: -o-linear-gradient(white, #d85570); /* For Opera 11.1 to 12.0 */ 
background: linear-gradient(top,#d85570, white); /* Standard syntax */
background: linear-gradient(to bottom, #white, #d85570); /* IE ? */
background: -ms-linear-gradient(top, #ffffff, #d85570); /* IE 11 */

这篇关于IE10,IE11中的跨浏览器CSS渐变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆