Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is .htc file ?How it works in Internet explorer

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);

}
like image 616
Ballu Rocks Avatar asked May 26 '12 14:05

Ballu Rocks


1 Answers

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).

like image 123
Tim M. Avatar answered Oct 20 '22 23:10

Tim M.