selcet
selcet

Reputation: 35

Crossbrowser css gradient in IE10, IE11

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.

link to buttons

enter image description here

HTML

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

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);

}

How I can fix it?

Upvotes: 2

Views: 12444

Answers (2)

iCyberPaul
iCyberPaul

Reputation: 650

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 */

Upvotes: 7

cukezr
cukezr

Reputation: 28

Try with http://css3pie.com/

example in css:

  background: -webkit-linear-gradient(#ffffff 0%, #000099 30%);
  background: -moz-linear-gradient(#ffffff 0%, #000099 30%);
  background: -o-linear-gradient(#ffffff 0%, #000099 30%);
  background: linear-gradient(#ffffff 0%, #000099 30%);
  -pie-background: linear-gradient(#ffffff 0%, #000099 30%);
  behavior: url("/Scripts/PIE.htc");
  background: -webkit-gradient(linear, 0 6px, 0 bottom, from(#ffffff), to(#000099));
  background: -ms-linear-gradient(top center, #ffffff 0%, #000099 30%);

Upvotes: 1

Related Questions