开发者

Is .htc file a good practice in older versions of IE for rounded corners like CSS3 has?

开发者 https://www.devze.com 2023-02-20 07:24 出处:网络
I am trying to make the simple html button with rounder corner using CSS3 but for IE i am using .htc file for ro开发者_如何学Pythonund curve, is the .htc file using is good habit or bad i am not able

I am trying to make the simple html button with rounder corner using CSS3 but for IE i am using .htc file for ro开发者_如何学Pythonund curve, is the .htc file using is good habit or bad i am not able to judgment to use this .html file.

My another worries is that progressive enhancement allow to use .htc file or not.

Please also tell me if there are some disadvantages to use .htc file.

I am new to css3, help much appreciated.


The disadvantage of those .htc-based solutions is that because they draw the corners using JavaScript and VML, they are slow (compared to browsers that have native border-radius support). However, you'll only usually notice this if you're using the effect extensively.

Unfortunately though, there isn't any better method to get rounded corners in older versions of IE (IE now supports border-radius in version 9):

  • Images are a lot of work (you have to make new images for different radii)
  • Pure JavaScript solutions doing things like making many divs to create the corners are an even slower solution.

What I would suggest is using CSS3PIE to make the rounded corners instead. This uses the same .htc/VML method, but it's an actively updated library doing it in the best way possible. Additionally, it provides support for more CSS3 eye-candy.


No, Its not a good practice, its a kind of hacking which make a bad impact on code and page performance.

.htc file force browser to artificially to draw the round corner using vml.

In this case you should use Progressive Enhancement, read this article http://en.wikipedia.org/wiki/Progressive_enhancement

this term is best practice for all browser and devices.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号