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
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?
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 */
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%);
Related
I'm having a border transition on a focus. When I focus the input field, I want the border to change color. This works.
What I don't want is to let the border load when the page load, which it does now. Why is it doing this?
<input type="stad" name="stad" value=""/>
input {
border: 7px #227a7b solid;
height: 20px;
width: 200px;
background: #1a5a78;
/* Old browsers */
background: -moz-linear-gradient(-45deg, #1a5a78 0%, #11c7b8 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #1a5a78), color-stop(100%, #11c7b8));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, #1a5a78 0%, #11c7b8 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, #1a5a78 0%, #11c7b8 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, #1a5a78 0%, #11c7b8 100%);
/* IE10+ */
background: linear-gradient(135deg, #1a5a78 0%, #11c7b8 100%);
/* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1a5a78', endColorstr='#11c7b8',GradientType=1 );
/* IE6-9 fallback on horizontal gradient */
padding: 5px;
margin-top: -50px;
transition: 1s border;
}
input:focus {
outline: none;
border: green 7px solid;
}
My issue is purely crossbrowser and i have tried almost everything. From importing the code from http://www.colorzilla.com/gradient-editor/ to playing with every possible combination and prefixes.
I have a H1 class wich is styled (primarely) :
.welcome h1 {
line-height: 1em;
margin: 0;
font-size: 120px;
background: -webkit-linear-gradient(#7c6510, #b9a044, #7c6510);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
padding-bottom: 25px;
text-shadow: 0px 0px 17px #b9a044;
}
<div class="welcome-container"><div class="welcome text-center"><h1>Pluche Lingerie</h1></div></div>
This works great in Chrome and Safari. But not in Mozilla and IE (v11)
So i have tried this:
.welcome h1 {
line-height: 1em;
margin: 0;
font-size: 120px;
background: -webkit-linear-gradient(#7c6510, #b9a044, #7c6510);
background: #7c6510;
/* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzdjNjUxMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iI2I5YTA0NCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM3YzY1MTAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #7c6510 0%, #b9a044 50%, #7c6510 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7c6510), color-stop(50%, #b9a044), color-stop(100%, #7c6510));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #7c6510 0%, #b9a044 50%, #7c6510 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #7c6510 0%, #b9a044 50%, #7c6510 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #7c6510 0%, #b9a044 50%, #7c6510 100%);
/* IE10+ */
background: linear-gradient(to bottom, #7c6510 0%, #b9a044 50%, #7c6510 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#7c6510', endColorstr='#7c6510', GradientType=0);
/* IE6-8 */
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
-moz-background-clip: text;
-moz-text-fill-color: transparent;
-o-background-clip: text;
-o-text-fill-color: transparent;
-ms-background-clip: text;
-ms-text-fill-color: transparent;
padding-bottom: 25px;
text-shadow: 0px 0px 17px #b9a044;
}
<div class="welcome-container"><div class="welcome text-center"><h1>Pluche Lingerie</h1></div></div>
And each combination possible (also without trying to make this work for IE). All i get is a beautifull background gradient in IE and Mozilla with white font. I have no idea what i am doing wrong, why does the:
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
and the versions for moz and ie not work?
Thanks!
I currently am trying to use a linear-gradient from CSS3 as the background of a site, and from what I can tell, am following the spec to comply with Internet Explorer right, but I can't tell what's not working here.
body {
padding: 0px;
margin: 0px 0px 0px 0px;
background: rgb(0,0,0); /* Old browsers */
background: -moz-linear-gradient(top, rgba(0,0,0,1) 0%, rgba(26,42,132,1) 40%, rgba(33,29,155,1) 50%, rgba(26,42,132,1) 60%, rgba(0,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,1)), color-stop(40%,rgba(26,42,132,1)), color-stop(50%,rgba(33,29,155,1)), color-stop(60%,rgba(26,42,132,1)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(26,42,132,1) 40%,rgba(33,29,155,1) 50%,rgba(26,42,132,1) 60%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(26,42,132,1) 40%,rgba(33,29,155,1) 50%,rgba(26,42,132,1) 60%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(bottom, rgba(0,0,0,1) 0%,rgba(26,42,132,1) 40%,rgba(33,29,155,1) 50%,rgba(26,42,132,1) 60%,rgba(0,0,0,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(0,0,0,1) 0%,rgba(26,42,132,1) 40%,rgba(33,29,155,1) 50%,rgba(26,42,132,1) 60%,rgba(0,0,0,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
}
We are using following CSS in one of our projects and it works on Chrome, Firefox and IE11.
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#000), to(transparent));
background-image: -webkit-linear-gradient(#000, transparent);
background-image: -moz-linear-gradient(#000, transparent);
background-image: -o-linear-gradient(#000, transparent);
background-image: linear-gradient(#000, transparent);
See this Fiddle as well: http://jsfiddle.net/3ck72fbc/
I'm not sure why this downdown menu won't show up in IE. Can anyone see what the problem is? It works in all the other browsers, just not IE. I know gradients in IE take a lot of thought. Here is my code.
.menu {
border: 1px solid #ccc;
background: #006699; /* Old browsers */
background: -moz-linear-gradient(top, #006699 0%, #1f416b 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#006699), color-stop(100%,#1f416b)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #006699 0%,#1f416b 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #006699 0%,#1f416b 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #006699 0%,#1f416b 100%); /* IE10+ */
background: linear-gradient(to bottom, #006699 0%,#1f416b 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#006699', endColorstr='#1f416b'); /* IE6-9 */
}
.menu li a {
padding: 15px 45px;
text-decoration: none;
font-size: 0.9em;
color: #fff;
font-family: Arial, sans-serif;
}
.menu li.current > a,
.menu li.current > a:hover,
.menu li.current.hover > a {
background: rgb(70,168,217); /* Old browsers */
background: -moz-linear-gradient(top, rgba(122,188,255,1) 0%, rgba(96,171,248,1) 44%, rgba(64,150,238,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(122,188,255,1)), color-stop(44%,rgba(96,171,248,1)), color-stop(100%,rgba(64,150,238,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(122,188,255,1) 0%,rgba(96,171,248,1) 44%,rgba(64,150,238,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(122,188,255,1) 0%,rgba(96,171,248,1) 44%,rgba(64,150,238,1) 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, rgba(122,188,255,1) 0%,rgba(96,171,248,1) 44%,rgba(64,150,238,1) 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7abcff', endColorstr='#4096ee',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, rgba(122,188,255,1) 0%,rgba(96,171,248,1) 44%,rgba(64,150,238,1) 100%); /* W3C */
color: #fff;
text-shadow: 0px -1px 0px rgba(0,0,0,0.2);
cursor: default;
}
.menu li a:hover,
.menu li.hover > a {
background: #b32416; /* Old browsers */
background: -moz-linear-gradient(top, #b32416 0%, #8f0222 44%, #6d0019 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b32416), color-stop(44%,#8f0222), color-stop(100%,#6d0019)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b32416 0%,#8f0222 44%,#6d0019 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b32416 0%,#8f0222 44%,#6d0019 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b32416 0%,#8f0222 44%,#6d0019 100%); /* IE10+ */
background: linear-gradient(to bottom, #b32416 0%,#8f0222 44%,#6d0019 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b32416', endColorstr='#6d0019'); /* IE6-9 */
}
Which IE version?
I know that you need something like this in the head of your html page. Has to do with SVG or something. Conditional Formatting.
<!-- following class is conditional for IE9 and must be put in elements for css gradient to work -->
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
filter: none;
}
</style>
<![endif]-->
Then apply this gradient class to elements using the gradients.
http://www.colorzilla.com/gradient-editor/
EDIT
OK. Did a little research and found that the filter should have an 8 digit hex code where the first two are the opacity. I think FF for 100% and 00 for 0%. Also, use double quotes ". Might make a difference.
So do something like this:
filter:progid:DXImageTransform.Microsoft.gradient
(startColorstr="#ff7abcff",endColorstr="#ff4096ee",GradientType=0);
I've got a link that I want to make look like a button with round corners and a gradient fill. It works fine in Chrome, but not in IE.
I've found that if I set display: inline-block, it shows the gradient, but removes the rounded corners. Does anybody know how to get around this issue in IE?
Demo in JSFiddle
HTML:
Hello World​
CSS:
a {
color: white;
padding: 8px;
background: #7db9e8;
background: -webkit-gradient(linear, left top, left bottom, from(#7db9e8), to(#1e5799));
background: -webkit-linear-gradient(top, #7db9e8, #1e5799);
background: -moz-linear-gradient(top, #7db9e8, #1e5799);
background: -ms-linear-gradient(top, #7db9e8, #1e5799);
background: -o-linear-gradient(top, #7db9e8, #1e5799);
background: linear-gradient(top, #7db9e8, #1e5799);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db9e8', endColorstr='#1e5799',GradientType=0);
zoom: 1;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
I know this question is quite old, however since it is unaswered and if this can help people, here is my solution to get a linear Gradient working in all mayor Browsers:
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #FFFFFF 0%, #BDBDBD 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #BDBDBD 100%);
/* Opera */
background-image: -o-linear-gradient(top, #FFFFFF 0%, #BDBDBD 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FFFFFF), color-stop(1, #BDBDBD));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #BDBDBD 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #FFFFFF 0%, #BDBDBD 100%);
There is also an onlie tool to create this CSS gradients, chek it here:
http://ie.microsoft.com/Testdrive/Graphics/CSSGradientBackgroundMaker/Default.html
You need to use the Microsoft filter:
filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr='#7db9e8', endColorstr='#1e5799');
Use that as a fallback for IE--it works in most versions.
See the specifications:
http://msdn.microsoft.com/en-us/library/ms532997%28v=vs.85%29.aspx
Instead of using a filter, you can always fallback with an image:
a {
color: white;
padding: 8px;
background: #7db9e8;
background: transparent url('gradient.png') 0 0 repeat;
background: -webkit-gradient(linear, left top, left bottom, from(#7db9e8), to(#1e5799));
background: -webkit-linear-gradient(top, #7db9e8, #1e5799);
background: -moz-linear-gradient(top, #7db9e8, #1e5799);
background: -ms-linear-gradient(top, #7db9e8, #1e5799);
background: -o-linear-gradient(top, #7db9e8, #1e5799);
background: linear-gradient(top, #7db9e8, #1e5799);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}