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);
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;
}
I'm pretty new to css, so please go easy on me :-)
I am trying to flip the gradient on a button when it's hovered on, but the hover function is not working when I test.
<head>
<style type="text/css">
.button_new{
border:1px solid #fab32f;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-size:12px;
font-family: arial, helvetica, sans-serif;
padding: 0px 8px;
text-decoration: none;
display: inline-block;
color: #a60201;
-webkit-font-smoothing: antialiased;
background-color: #fab32f;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fccd78), to(#f8b030);
background-image: -webkit-linear-gradient(top, #fccd78, #f8b030);
background-image: -moz-linear-gradient(top, #fccd78, #f8b030);
background-image: -ms-linear-gradient(top, #fccd78, #f8b030);
background-image: -o-linear-gradient(top, #fccd78, #f8b030);
background-image: linear-gradient(to bottom, #fccd78, #f8b030);
}
.button_new:hover{
border: 1px solid #ffa700;
background-color: #ffa700;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f8b030), to(#fccd78));
background-image: -webkit-linear-gradient(top, #f8b030, #fccd78);
background-image: -moz-linear-gradient(top, #f8b030, #fccd78);
background-image: -ms-linear-gradient(top, #f8b030, #fccd78);
background-image: -o-linear-gradient(top, #f8b030, #fccd78);
background-image: linear-gradient(to bottom, #f8b030, #fccd78);
}
</style></head>
<body>
<a class="button_new" href="#">Posters <span style="color:#fff; font-weight:bold; font-size:14px;">></span></a>
</body>
Thanks in advance for your help!
Your syntax for -webkit-gradient is incorrect. Remove these two lines and it works :
background-image: -webkit-gradient(linear, left top, left bottom, from(#fccd78), to(#f8b030);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f8b030), to(#fccd78));
Demonstration
update your css with this:
.button_new{
border:1px solid #fab32f;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-size:12px;
font-family: arial, helvetica, sans-serif;
padding: 0px 8px;
text-decoration: none;
display: inline-block;
color: #a60201;
-webkit-font-smoothing: antialiased;
background: #fccd78; /* Old browsers */
background: -moz-linear-gradient(top, #fccd78 0%, #f8b030 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fccd78), color-stop(100%,#f8b030)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fccd78 0%,#f8b030 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fccd78 0%,#f8b030 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fccd78 0%,#f8b030 100%); /* IE10+ */
background: linear-gradient(to bottom, #fccd78 0%,#f8b030 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fccd78', endColorstr='#f8b030',GradientType=0 ); /* IE6-9 */}
.button_new:hover {
background: #f8b030; /* Old browsers */
background: -moz-linear-gradient(top, #f8b030 0%, #fccd78 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8b030), color- stop(100%,#fccd78)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f8b030 0%,#fccd78 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f8b030 0%,#fccd78 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f8b030 0%,#fccd78 100%); /* IE10+ */
background: linear-gradient(to bottom, #f8b030 0%,#fccd78 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8b030', endColorstr='#fccd78',GradientType=0 ); /* IE6-9 */
}
I have a pretty straight-forward navigation menu, and I'm trying to style one item differently than the others. However, only the background is applied while other things like border radius and link color are not.
This is the menu:
<div class="menu">
<ul>
<li>Page1</li>
<li>Page2 </li>
<li>Page3 </li>
<li class="extranav">Extra</li>
</ul>
</div>
These are the generic menu list styles:
.menu ul{ margin:0px; padding:0px;}
.menu ul li{ float:left; background:url(../images/sprator.png) right top no-repeat; padding-right:1px;}
.menu ul li a{display:block; padding:0px 23px; font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#fff; line-height:46px; text-decoration:none; text-transform:uppercase;}
.menu ul li a:hover{ display:block;background: #b04141; /* Old browsers */
background: -moz-linear-gradient(top, #b04141 0%, #c35151 39%, #c35151 62%, #c35151 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b04141), color-stop(39%,#c35151), color-stop(62%,#c35151), color-stop(100%,#c35151)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b04141 0%,#c35151 39%,#c35151 62%,#c35151 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b04141 0%,#c35151 39%,#c35151 62%,#c35151 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b04141 0%,#c35151 39%,#c35151 62%,#c35151 100%); /* IE10+ */
background: linear-gradient(top, #b04141 0%,#c35151 39%,#c35151 62%,#c35151 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b04141', endColorstr='#c35151',GradientType=0 ); /* IE6-9 */}
And this is what I'm trying to apply to the extra nav element:
.extranav a{
height:46px;
color:#FF0000;
line-height:46px;
display:block;
background: #206818; /* Old browsers */
background: -moz-linear-gradient(top, #024A00 0%, #206818 39%, #347C2C 62%, #3E8636 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#024A00), color-stop(39%,#206818), color-stop(62%,#347C2C), color-stop(100%,#3E8636)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #024A00 0%,#206818 39%,#347C2C 62%,#3E8636 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #024A00 0%, #206818 39%, #347C2C 62%, #3E8636 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #024A00 0%, #206818 39%, #347C2C 62%, #3E8636 100%); /* IE10+ */
background: linear-gradient(top, #024A00 0%, #206818 39%, #347C2C 62%, #3E8636 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#024A00', endColorstr='#3E8636',GradientType=0 ); /* IE6-9 */}
-moz-border-radius: 0px 0px 10px 0px;
-webkit-border-radius:0px 0px 10px 0px;
-khtml-border-radius: 0px 0px 10px 0px;
border-radius:0px 0px 10px 0px;
}
The background properties are applied properly, while other things like link color and border radius are not. Why is this happening and how do I fix it?
Fiddle: http://jsfiddle.net/68Vb6/
The border radius is not part of the style, you have a } that ends the style block before it.
Change this line:
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#024A00', endColorstr='#3E8636',GradientType=0 ); /* IE6-9 */}
to:
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#024A00', endColorstr='#3E8636',GradientType=0 ); /* IE6-9 */
The .menu ul li a selector is more specific than the .extranav a selector, so the settings in the first rule will take precedence. Change the selector to .menu ul li.extranav a to make it more specific.
I am trying to get The degree of color of the box in the picture
http://i46.tinypic.com/iefcpl.png
i like the box in the picture and i want make similar one
This is my code, and i can't make similarty
<style>
.b{
background:-moz-linear-gradient(top, #fff, #ebebeb);
height:25px;
border:1px #efefef solid;
}
</style>
<div class="b">
</div>
.b{
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #ebebeb 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ebebeb)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#ebebeb 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#ebebeb 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#ebebeb 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#ebebeb 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ebebeb',GradientType=0 ); /* IE6-9 */
height:25px;
border:1px #DDDDDD solid;
}
I used Ultimate CSS Gradient Generator to generate the gradient for all browsers.
DEMO
I have the following code:
#wrapper {
position:relative; top:0; right: 0; left:0; bottom: 0;
display: block;
background: #657575; /* Old browsers */
background: -moz-linear-gradient(left, #657575 0%, #758585 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#657575), color-stop(100%,#758585)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #657575 0%,#758585 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #657575 0%,#758585 100%); /* Opera11.10+ */
background: -ms-linear-gradient(left, #657575 0%,#758585 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#657575', endColorstr='#758585',GradientType=1 ); /* IE6-9 */
background: linear-gradient(left, #657575 0%,#758585 100%); /* W3C */
}
But when I publish I don't see anything. Am I setting something wrong?
I have my wrapper set up right at the start as in:
<body>
<div id="wrapper">
works fine for me http://jsfiddle.net/bvTMW/
How about adding height & width