I downloaded the .htc file and embedded in css to get the rounded corners in internet explorer 8.But i am wondering how it works
.curved {
-moz-border-radius:10px;
-webkit-border-radius:10px;
behavior:url(border-radius.htc);
}
It's an HTML Component, a means of encapsulating logic on a web page. Behaviors were described in a 1999 w3 CSS working draft but (as far as I know) only Microsoft provided an implementation in IE 5 and today there are better ways of accomplishing the same tasks.
See also: http://msdn.microsoft.com/en-us/library/ms531018.aspx
HTCs should only be used as a fallback mechanism (which your example demonstrates). Most of what is possible with them is possible using standard, cross-browser CSS and JavaScript in IE 9 and higher.
As to why it works, my guess is that the behavior manipulates IE-specific functionality such as DHTML filters or VML which can be used to achieve visual results that were ahead of their time (though now deprecated).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With