To implement the border-radius in IE8 I use border-radius.htc
The block in which to work correctly realzovat border-radius:
.mc-button
{
-moz-transition: all 0.218s ease 0s;
-moz-user-select: none;
background-color: #CBCBCB;
background-image: -moz-linear-gradient(center top , #CBCBCB, #DCDCDC);
border: 1px solid #DCDCDC;
color: #FFFFFF;
cursor: default;
display: inline-block;
font-size: 11px;
font-weight: bold;
height: 29px;
line-height: 29px;
min-width: 70px;
padding: 0 8px !important;
text-align: center;
overflow: visible;
font-family: inherit;
font-size: inherit;
float: left;
text-decoration: none;
display: block;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
-moz-outline-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family: Arial, Sans-Serif !important;
behavior:url(Content/border-radius.htc);
}
According to the list of attached files - border-radius.htc connects to the page
Can you please tell how to solve the problem?
UPDATE (06/13/2012)
If the code is replaced by a button:
.mc-button
{
border: 1px solid #696;
height: 29px;
line-height: 29px;
min-width: 70px;
text-align: center;
padding: 0 8px !important;
overflow: visible;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
float: left;
display: block;
background: #00ADEE;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#00ADEE), to(#0078A5));
background: -webkit-linear-gradient(#00ADEE, #0078A5);
background: -moz-linear-gradient(#00ADEE, #0078A5);
background: -ms-linear-gradient(#00ADEE, #0078A5);
background: -o-linear-gradient(#00ADEE, #0078A5);
background: linear-gradient(#00ADEE, #0078A5);
-pie-background: linear-gradient(#00ADEE, #0078A5);
behavior: url("Content/PIE.htc");
}
and to declare as:
<a id="login_button" class="mc-button mc-button-submit ">SomeText</a>
.mc-button-submit
{
border: 0px solid #0076A3;
background: #00ADEE;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#00ADEE), to(#0078A5));
background: -webkit-linear-gradient(#00ADEE, #0078A5);
background: -moz-linear-gradient(#00ADEE, #0078A5);
background: -ms-linear-gradient(#00ADEE, #0078A5);
background: -o-linear-gradient(#00ADEE, #0078A5);
background: linear-gradient(#00ADEE, #0078A5);
-pie-background: linear-gradient(#00ADEE, #0078A5);
color: #FFFFFF;
text-align: center;
}
Rounding it disappears. Adding to the .mc-button-submit line behavior: url ("Content / PIE.htc"); does not help.
Can you please tell how to connect a second class with the parameters of the background?
Standalone .htc hack is not working for background gradient and border-radius both at the same time.
Try to replace css gradient with simple image. This trick will work.
Also you can use css3pie (thanks to #dop-trois) — this pure Javascript tool is more perfect than standalone .htc file.
PS. Inset box-shadows cannot be implemented in both solutions.
PPS: the code you need is here: (i changed it a bit to make it more valid and correct):
.mc-button {
font: bold 11px/29px Arial, Helvetica, sans-serif !important;
text-align: center;
text-decoration: none;
color: #FFFFFF;
border: 1px solid #DCDCDC;
height: 29px;
min-width: 70px;
padding: 0 8px !important;
overflow: visible;
display: block;
float: left;
/* Unique link for this gradient — http://www.colorzilla.com/gradient-editor/#cbcbcb+0,dcdcdc+100;Custom */
background-color: #CBCBCB;
background: -moz-linear-gradient(top, rgba(203,203,203,1) 0%, rgba(220,220,220,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(203,203,203,1)), color-stop(100%,rgba(220,220,220,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* W3C */
/* css3 stuff below: (via css3please.com) */
/* no one prefix except `-webkit` is needed nowadays for `border-radius` */
-webkit-border-radius: 5px;
border-radius: 5px;
-webkit-transition: all 0.218s ease-out;
-moz-transition: all 0.218s ease-out;
-ms-transition: all 0.218s ease-out;
-o-transition: all 0.218s ease-out;
transition: all 0.218s ease-out;
/* PIE specific accordingly http://css3pie.com/documentation/q-and-a/ */
behavior: url(PIE.htc);
}
You should be sure that you have included PIE.htc correctly (important!)
Relative questions
Using CSS3Pie htc for border-radius in IE8
CSS3 PIE - Giving IE border-radius support not working?
CSS3 PIE - Giving IE border-radius support not working?
Accordingly to answers possible problems may be in mime type ("text/x-component").
Also possible solution may be:
position: relative;
z-index: 0;
To apply gradients and border-radius, I recommend CSS3 Pie. It's the most powerful tool i know, to apply CSS3 properties in IEs.
Apply gradients in IEs):
#myElement {
background: #CCC; /*fallback for non-CSS3 browsers*/
background: -webkit-gradient(linear, 0 0, 0 100%, from(#CCC) to(#EEE)); /*old webkit*/
background: -webkit-linear-gradient(#CCC, #EEE); /*new webkit*/
background: -moz-linear-gradient(#CCC, #EEE); /*gecko*/
background: -ms-linear-gradient(#CCC, #EEE); /*IE10*/
background: -o-linear-gradient(#CCC, #EEE); /*opera 11.10+*/
background: linear-gradient(#CCC, #EEE); /*future CSS3 browsers*/
-pie-background: linear-gradient(#CCC, #EEE); /*PIE*/
behavior: url(PIE.htc);
}
Apply border-radius in IEs):
#myAwesomeElement {
border: 1px solid #999;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
behavior: url(path/to/PIE.htc);
}
You'll need PHP to get it work.
Live demo on CSS3 Pie's website.
Btw.: Applying border-radius & gradients the same time is possible with this tool ;)
Hope this helps :)
To apply Gradients, Box shadows and Border-radius, I recommend CSS3 Pie. I used it in cook&smile project and it fully works in IE.
*{ behavior:url(path/PIE.htc);}
.border_radius_div{ position:relative; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px;}
.gradient_div{ position:relative;
background: #EEFF99;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#EEFF99), to(#66EE33));
background: -webkit-linear-gradient(#EEFF99, #66EE33);
background: -moz-linear-gradient(#EEFF99, #66EE33);
background: -ms-linear-gradient(#EEFF99, #66EE33);
background: -o-linear-gradient(#EEFF99, #66EE33);
background: linear-gradient(#EEFF99, #66EE33);
-pie-background: linear-gradient(#EEFF99, #66EE33); }
Visit this website to explore yourself further.
http://css3pie.com
Note:
Don't forget to use position (relative or absolute) where we are using Border-radius, gradients and box shadows.
Don't forget to use behavior:url(xhtml_folder/PIE.htc);
And the important thing is don't forget to put the PIE.htc in xhtml folder.
Related
I'm placing a button (created by a css) in my html page.
Currently this button inherits the link color from the div.
I'm trying to override these link colors and make the button show a link in a different color.
I have created a button style in the css file like this, and I was pretty sure by specifying the link colors in the button, I would automatically override the div link colors.
.button {
display: inline-block;
padding: 0 14px;
margin: 8px 0 0;
height: 32px;
line-height: 32px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
text-decoration: none;
position: relative;
overflow: hidden;
vertical-align: top;
color: #fff;
background: #49b1fb;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #5196d5), color-stop(1, #49b1fb));
background: -ms-linear-gradient(bottom, #5196d5, #49b1fb);
background: -moz-linear-gradient(center bottom, #5196d5 0%, #49b1fb 100%);
border-bottom: 1px solid #4c8cc8;
link {text-decoration: none; color: #FFF;}
visited {text-decoration: none; color: #FFF;}
hover {text-decoration: none; color: #FFF;}
active {text-decoration: none; color: #FFF;}
}
I use the button like this:
<div id="widecontent">
<div id="content">
<div id="content-inner">
<div class="column_left">
<h2>Download</h2>Click below to download the app:
<br/>
Download
</div>
However, the link color of the button is the same as the div style.
The link colors as I have defined them in the css file don't show an effect.
What is the correct way to override the link color of the div / what am I doing incorrectly?
You should define it like this for hover for example:
.button {
display: inline-block;
padding: 0 14px;
margin: 8px 0 0;
height: 32px;
line-height: 32px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
text-decoration: none;
position: relative;
overflow: hidden;
vertical-align: top;
color: #fff;
background: #49b1fb;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #5196d5), color-stop(1, #49b1fb));
background: -ms-linear-gradient(bottom, #5196d5, #49b1fb);
background: -moz-linear-gradient(center bottom, #5196d5 0%, #49b1fb 100%);
border-bottom: 1px solid #4c8cc8;
}
.button:hover {
text-decoration: none;
color: #FFF;
}
you are confusing properties with pseudo-classes (:active/:hover and etc)
so you should use them outside of the rule, and not inside.
.button {
display: inline-block;
padding: 0 14px;
margin: 8px 0 0;
height: 32px;
line-height: 32px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
text-decoration: none;
position: relative;
overflow: hidden;
vertical-align: top;
color: #fff;
background: #49b1fb;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #5196d5), color-stop(1, #49b1fb));
background: -ms-linear-gradient(bottom, #5196d5, #49b1fb);
background: -moz-linear-gradient(center bottom, #5196d5 0%, #49b1fb 100%);
border-bottom: 1px solid #4c8cc8;
}
.button:visited {
color: green
}
.button:focus {
color: purple
}
.button:hover {
color: red
}
.button:active {
color: yellow
}
I use the button like this:
<div id="widecontent">
<div id="content">
<div id="content-inner">
<div class="column_left">
<h2>Download</h2>Click below to download the app:
<br/>
Download
</div>
I wonder why the div bar doesn't show green background color halfway, from left to middle. It just show the whole div bar. What could be the problem? THanks..
.BioUploadProgressBar p {
display: block;
width: 350px;
padding: 2px 5px;
margin: 12px 0;
border: 1px inset #446;
border-radius: 5px;
}
.BioUploadProgressBar p.initialize {
/*background: #0c0 none 0 0 no-repeat;*/
background-color: #0c0;
background-image: none;
background-position: 50% 0px;
background-repeat: no-repeat;
}
<div>
<div class='BioUploadProgressBar'>
<p class="initialize">Upload file 0 %</p>
</div>
</div>
Background-Position only applies to Background-Image. You'll have these options:
Use a Background-Image (But also have an additional Request)
Use a second DIV
Use a CSS Gradient (http://www.colorzilla.com/gradient-editor/ - No IE8 and stuff)
Try using this:
.progress {
height: 20px;
overflow: hidden;
background-color: #F5F5F5;
border-radius: 4px;
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1) inset;
}
.cpu {
color: #FFF;
text-align: center;
transition: width 2.0s ease 0s;
background-color: #FF6633;
}
<div class="progress" style="width:500px;">
<div id="cpu" class="cpu" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 10%">
<span>10</span>
</div>
</div>
because your HTML is incorrect and your CSS is even more incorrect, you're using background properties that applies to background images, not colors, change your HTML to this:
<div>
<div class='BioUploadProgressBar'>
<div class="initialize">Upload file 0 %</div>
</div>
</div>
and your CSS to this:
.BioUploadProgressBar {
display: block;
width: 350px;
margin: 12px 0;
border: 1px solid #446;
border-radius: 5px;
}
.initialize {
border-radius: 5px;
display:inline-block;
background: #0c0;
width:175px;
;
padding:5px;
}
see FIddle
Gradient solution via colorzilla
.partialGradiend{
background: -moz-linear-gradient(left, rgba(0,204,0,1) 0%, rgba(0,204,0,1) 50%, rgba(0,204,0,0) 51%, rgba(0,204,0,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(0,204,0,1)), color-stop(50%,rgba(0,204,0,1)), color-stop(51%,rgba(0,204,0,0)), color-stop(100%,rgba(0,204,0,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(0,204,0,1) 0%,rgba(0,204,0,1) 50%,rgba(0,204,0,0) 51%,rgba(0,204,0,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(0,204,0,1) 0%,rgba(0,204,0,1) 50%,rgba(0,204,0,0) 51%,rgba(0,204,0,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(0,204,0,1) 0%,rgba(0,204,0,1) 50%,rgba(0,204,0,0) 51%,rgba(0,204,0,0) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(0,204,0,1) 0%,rgba(0,204,0,1) 50%,rgba(0,204,0,0) 51%,rgba(0,204,0,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00cc00', endColorstr='#0000cc00',GradientType=1 ); /* IE6-9 */
width:300px;
border: 1px inset #446;
border-radius: 5px;
text-align:center;
padding:10px 0px;
}
<div class="partialGradiend" style="">
50%
</div>
My button works in all other browsers except IE. I thought the 'border-radius' was suppose to work for IE?
.simpleHelp {
border-top: 1px solid #ffffff;
background: #910330;
background: -webkit-gradient(linear, left top, left bottom, from(#790228),
to(#910330));
background: -webkit-linear-gradient(top, #790228, #910330);
background: -moz-linear-gradient(top, #790228, #910330);
background: -ms-linear-gradient(top, #790228, #910330);
background: -o-linear-gradient(top, #790228, #910330);
padding: 10.5px 21px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
border-radius: 40px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: #ffffff;
font-size: 17px;
font-family: Georgia, Serif;
text-decoration: none;
vertical-align: middle;
}
Border-radius (and, in fact, any CSS3) only works on IE9+, however, you can "retrofit" CSS3 stuff onto older versions of IE9 with a fun little library called CSS3PIE. If you really need borders and shadows in IE, then CSS3PIE is the way to go. However, letting older browsers gracefully degrade is okay to do, too.
I'm afraid that border-radius only works in IE9 and up.
http://www.findmebyip.com/litmus/
I am using a webfont (poly) on my page on several buttons. In firefox, everything appears right, but in Chrome the first button's font seems bolder than the others despite using the same CSS3 code (unless I'm missing a typo).
http://ashgavs.cloudant.com/site/_design/AshGavsCouch/betcha/index.html
thats the page, look at Login vs. Login with facebook or Sign up. It's not the length of the text that's affecting the font weight, tested that already.
here's the CSS for the first and second buttons:
#login{
position: absolute;
top: 137px;
left: 19px;
padding-top: 10px;
padding-bottom: 10px;
border-top: 1px solid #aff797;
background: #369942;
background: -webkit-gradient(linear, left top, left bottom, from(#27ca3d), to(#369942));
background: -webkit-linear-gradient(top, #27ca3d, #369942);
background: -moz-linear-gradient(top, #27ca3d, #369942);
background: -ms-linear-gradient(top, #27ca3d, #369942);
background: -o-linear-gradient(top, #27ca3d, #369942);
-webkit-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 5px;
-webkit-box-shadow: rgba(0,0,0,.7) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,.7) 0 1px 0;
box-shadow: rgba(0,0,0,.7) 0 1px 0;
text-shadow: 0 1px 0 #91d99a;
color: #0e5817;
font-size: 24px;
font-family: 'Poly', serif;
text-decoration: none;
vertical-align: center;
width: 229px;
}
#loginFB{
position: absolute;
top: 196px;
left: 19px;
padding-top: 10px;
padding-bottom: 10px;
border-top: 1px solid #65a9d7;
background: #3e779d;
background: -webkit-gradient(linear, left top, left bottom, from(#65a9d7), to(#3e779d));
background: -webkit-linear-gradient(top, #65a9d7, #3e779d);
background: -moz-linear-gradient(top, #65a9d7, #3e779d);
background: -ms-linear-gradient(top, #65a9d7, #3e779d);
background: -o-linear-gradient(top, #65a9d7, #3e779d);
-webkit-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 5px;
-webkit-box-shadow: rgba(0,0,0,.7) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,.7) 0 1px 0;
box-shadow: rgba(0,0,0,.7) 0 1px 0;
text-shadow: 0 1px 0 #7ca9c7;
color: #0e3458;
font-size: 24px;
font-family: 'Poly', serif;
text-decoration: none;
vertical-align: center;
width: 229px;
}
Both buttons inherit properties from the same divs, so that can't be the issue either. Thanks.
--Ashley
It may be with your particular browser. Regardless, a very good thing to do (pretty much a requirement these days) is to add a CSS Reset before your own CSS definitions. Just Google "CSS Reset". You will see a lot of results. Basically it removes browser specific formatting so that your CSS is the only effective formatting on the page. No unexpected changes or additions from the browser. Often doing this will solve the kinds of issues you describe. You might want to research the idiosyncrasies of your browser, but to save time just try the reset first.
I am presently doing a project with menus and trying to implement something which is the same menu appeared below:
And now I have got which is similar to this menu and trying to modify it but I am stucked with it.
Here is the screenshot of my menu how it looks in chrome:
And this is how it looks in IE8 and firefox:
The problem is I am able to get rounded corners but the gloss and the bump over the menu which is shown in 1st menu is not appearing in my menu as it is showing as flat in chrome,IE as well as firefox.So how do I modify in order to get the same menu as shown in 1st figure.
Here is my menu css:
.menu
{
height: 18px;
margin-left:318px;
margin-top:10px;
width:914px;
border: 1px solid #d6d6d6;
background: #fff;
padding: 14px;
text-align: center;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background: #1612CE;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#1612CE), to(#3B91F1));
background: -webkit-linear-gradient(#1612CE, #3B91F1);
background: -moz-linear-gradient(#1612CE, #3B91F1);
background: -ms-linear-gradient(#1612CE, #3B91F1);
background: -o-linear-gradient(#1612CE, #3B91F1);
background: linear-gradient(#1612CE, #3B91F1);
behavior: url(css/ie-css3.htc);
}
.blue {
background : rgb(52,119,210);
background : -webkit-gradient(linear, left top, left bottom, from(rgb(52,119,210)), to(rgb(34,98,188)));
background : -moz-gradient(linear, left top, left bottom, from(rgb(52,119,210)), to(rgb(34,98,188)));
border: 1px solid #2f8893;
}
.blue li a
{
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,.40);
}
a {
text-decoration: none;
color: #262626;
line-height: 20px;
}
ul
{
margin: 0;
padding: 0;
z-index: 300;
text-align:right;
}
li
{
padding: 0 10px;
display:inline-block;
}
li:first-child {
float:left;
}
This is how I'm showing it:
<div class="menu blue">
<ul >
<li class="active">Home</li>
<li>About</li>
<li>Blog</li>
<li>Services</li>
<li>Portfolio</li>
<li>Contacts</li>
<li>Back to Article</li>
<li>How it Works?</li>
</ul>
</div>
Try this combination of colors: http://jsfiddle.net/TLS3Y/4/
CSS3 Please! makes all these CSS3 rules so easy :)
.menu {
border-color: #598FD1 #598FD1 #1A53A2;
border-style: solid;
border-width: 2px 1px 3px;
height: 18px;
margin-left: 318px;
margin-top: 10px;
padding: 14px;
text-align: center;
width: 914px;
background-color: #2A72D8;
background-image: -webkit-gradient(linear, left top, left bottom, from(#2A72D8), to(#1A53A2));
background-image: -webkit-linear-gradient(top, #2A72D8, #1A53A2);
background-image: -moz-linear-gradient(top, #2A72D8, #1A53A2);
background-image: -ms-linear-gradient(top, #2A72D8, #1A53A2);
background-image: -o-linear-gradient(top, #2A72D8, #1A53A2);
background-image: linear-gradient(top, #2A72D8, #1A53A2);
-webkit-box-shadow: inset 0px 0px 9px #2A72D8;
-moz-box-shadow: inset 0px 0px 9px #2A72D8;
box-shadow: inset 0px 0px 9px #2A72D8;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
behavior: url(css/ie-css3.htc);
}
First of all i encourage you to use Lea Verou's http://leaverou.github.com/prefixfree/ which saves you the pain of having to add all those prefixes for different browsers and makes just one linear-gradient declaration
Second you are not using the proper declarations for linear-gradient in webkit. Should be
-webkit-linear-gradient(rgb(52,119,210),rgb(34,98,188))
This is the shorthand method which you should use since you are not specifying any angles for your gradient
This is also available in FF
background: -moz-linear-gradient(rgb(52,119,210),rgb(34,98,188)); /* Firefox */
background: -webkit-linear-gradient(rgb(52,119,210),rgb(34,98,188)); /* Webkit */
For a 3d-er look add box-shadow set on inset
box-shadow:inset 0 1px 0 #fff; // for a nice thing white line at the top of the menu
You can also chain the box-shadow declarations and have
box-shadow:inset 0 1px 0 #fff, 0 2px 5px #222 // thing white line at the top and drop shadow
You can emboss the ul using box-shadow:
div.blue {
box-shadow: 2px 2px 2px #888888;
}
Gradient can be made with linear-gradient. I like the generator at http://gradients.glrzad.com/.