Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/htmlremix/public_html/wp-content/plugins/top-level-cats/top-level-cats.php on line 58
CSS level 3 styles in Internet Explorer 6 onwards | HTMLRemix.com
Categories: Programming

CSS level 3 styles in Internet Explorer 6 onwards

People always hate IE because of poor support for CSS. But I am gonna make them love it by giving CSS3 support for IE6 onwards. Now IE6 supports border-radius and box-shadow.

As web developers, we all hate Internet explorer to an extant. But in my earlier post, I wrote why not to hate Microsoft and IE. It is the people who use out dated software (IE6 is almost ten years old) and try to run our CSS3 level high Ajax’s web 2.0 designs.

border-radius

Last year, I published an htc file, which makes Internet explorer 6 to have rounded corner DIVs. For other modern browsers, we can have border-radius CSS property. For mozilla, you need to prefix -moz- and for webkit based browsers (Safar, Chrome) prefix -webkit- . SO the CSS for a DIV with rounded edges will have following styles.
.curved { -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }

As IE wont support these CSS properties, you will have to add one more line of css and an HTC file. Here is more explanation how to make rounded corner divs in IE.

Good news : Microsoft’s Internet Explorer 9 is expected to support border-radius property.

Early this month, Nick Fetchak of fetchak.com sent me a new htc file with support for IE5 to IE8 which is amazing and working well. You can find the latest version that file here.

box-shadow

Box shadow is another simply amazing CSS3 property, which is unimaginable to work in IE. It works on Safari 3+ and Firefox 3.1 onwards and Google Chrome. I am not aware of Opera this time. So what you think about making this work on IE6 ? No kidding..

CSS for box-shadow is:
box-shadow: 10px 10px 5px #888; padding: 5px 5px 5px 15px;

For older version of Firefox, you might have to add -moz- and for Safari and Chrome, try -webkit- as prefix. (My Chrome is already supporting without any prefix).

So, here what you need for IE to make box-shadow.

behavior: url(box-shadow.htc);

Download the htc file here or Demo here. The project is hosted on Google code.

Remiz

Remixed version of unstable human emotions and thirst of mankind actions. UX designer, UI developer and HE of WebCastle Media Pvt LTD

View Comments

  • I also had problems when combining this fix when using AJAX to load HTML/CSS, fine in every browser excet IE where I got a debug error. going to out a sad work around for IE elements but wont look as cool as everything else - apart from that I love the idea and implementation :@)

  • Hello!.. since i'm having some problem after using it with AJAX, bourder radius div doesn't shows untill i resize the window, i'd like to know if is there any way to manually refresh at the ajax success event. Sorry about my english, i speak spanish.

    • Sure, there is no support for ajax at the moment because the svg are created while page is loaded. Keep watching for an update.

  • Hi,

    It did not support one or two corners. Any idea?

    -moz-border-radius-bottomright: 10px;
    -webkit-border-bottom-right-radius: 10px;
    -moz-border-radius-bottomleft: 10px;
    -webkit-border-bottom-left-radius: 10px;

    Thanks,

  • Thanks for this great work. But I discovered a problem when using the behavior combined with a filter:...gradient(..).
    I use this css technique to generate nice Input Buttons in Forms. In other modern browsers I'd give it a gradient background and a rounded border-radius and it looks great.
    Now, using this htc file is working very good for me. I can generate the rounded borders. With the IE filter css property I can also add gradient backgrounds. But those filters always paint above the rounded corners.
    Is there a way to get the disired look without using gradient background images?

    Best Regards

  • Hi, great post. It's a nice solution in small developements. I've tried the '.htc method' and I found these problems:

    - It doesn't work in chrome correctly.
    - It doesn't support background-repeat or background-position as well.
    - Cannot set borders separately.
    - Serious problems with asyncronous calls in jQuery 1.4.
    - In the long term, it makes trouble in large developements with a lot of code.

    Regards.

  • @Gabriel Memmel
    Great fix!
    I hope someone else could fix the involontary background-repeat... :-)

  • What steps will reproduce the problem?
    1. Use JqueryUI theme
    2. Apply behavior to a jqueryui class
    3. See that the elements of jquery just disappear...:(

    What is the expected output? What do you see instead?

    The output will be the invisible elements!

    What version of the product are you using? On what operating system?
    I am using the version downloaded from here...

    Please provide any additional information below.

    I am using the JqueryUI theme for a project, and I want to have the
    -moz-border-radius behavior for IE and use your ie-css3.htc in order to do
    this, but if I apply the behavior: ie-css3.htc to a class of jqueryui it
    make the element invisible, and don't know what it's causing the
    problem....Please help me out...

    Check the attach PrtScr to see the jquery elements

    I put the behavior to a different class which is not jquery and it's okay
    despite the fact that it's duplicating the background inside the .blueBox
    (it's the name class that I attach here: )
    /*********************************************/
    .blueBox{
    background: #eff7ff url("/media/images/apps/core/admin/green/info.png")
    no-repeat left;
    padding-left: 15px;
    border: 1px solid #b5ceee;
    margin-top: 10px;
    margin-bottom: 10px;
    width:400px;
    -moz-border-radius:10px;
    behavior: url(/media/js/jquery/ie-css3.htc);
    }
    /*********************************************/
    Shot at 2010-06-03

    http://yfrog.com/j3jquerydropdownj

    Shot at 2010-06-03

    http://yfrog.com/jyjquerydialogj

    Shot at 2010-06-03

    http://yfrog.com/2pblueboxj

  • Hello, is very good tool, about the color of the shadow, I solved that problem with some small modifications, I'm sending to you to upgrade

    file: ie-css3.htc

    1- Replace:

    var match = style.match(/^(\d+)px (\d+)px (\d+)px/);

    to:

    var match = style.match(/^(\d+)px (\d+)px (\d+)px (#[a-f0-9]{3,6}|[a-z]+)?/i);

    2- Add (line 56):

    sh_color = RegExp.$4;

    3- Replace:

    shadow.style.filter = 'progid:DXImageTransform.Microsoft.Blur(pixelRadius='+

    shadow.userAttrs.radius +',makeShadow=true,shadowOpacity=1)';

    to

    shadow.style.filter = 'progid:DXImageTransform.Microsoft.Blur(pixelRadius='+

    shadow.userAttrs.radius +',makeShadow=false,shadowOpacity=1)';

    4- Add (line 83):

    var sh_fill = document.createElement('v:fill');
    sh_fill.color = sh_color;
    sh_fill.className = 'vml_box_shadow_fill';
    sh_fill.type = 'tile';
    shadow.appendChild(sh_fill);

    excuse my English (google translator), I speak Spanish.

1 2 3

Recent Posts

Revolutionizing Web Development with AI: Tools and Techniques for Improved Productivity and Accuracy

AI is being used in programming to improve efficiency, accuracy and automation. It is being used in machine learning algorithms…

11 months ago

Apple push notification php example code 2021

For a long time since Push notification became a thing on iOS, it was very simple to integrate push notification…

2 years ago

Solved: MySQL convert_tz returns null on MacOS Catalina using XAMPP

Note: A little bit of a story since I haven't been writing for a while. If you are in a…

4 years ago

Why You Should Hire a Creative Marketing Agency for Your Next Campaign

There are few things that are quite as universally important in a business like marketing. Good marketing is at the…

4 years ago

Bring back PPTP VPN on iOS 10 and macOs sierra

Since latest iOS and macOs removed support for PPTP VPN from their built in client, here is how you can…

7 years ago

This will Change

Back to habits of young days. Shaping up another life. Starting like a kid who is a great king.

9 years ago