What is the "behavior" attribute in CSS?

6

I have seen in some CSS codes made to work in the beautiful browser Internet Explorer the following attribute:

img {
  behavior: url(ie_png.htc);
}

What is the purpose of this behavior ?

Does it only work for Internet Explorer?

    
asked by anonymous 10.12.2015 / 16:29

1 answer

3

Yes, it only works for Internet Explorer.

It's a Microsoft extension for CSS.

What does it do?

Arrow or search the location of the behavior script for an element Dynamic HTML (DHTML) .

These are usually .htc files, made up of HTML, scripts, and HTC-specific elements.

Syntax

behavior: url(sLocation) | url(#objID) | url(#default#behaviorName)

Properties

url(sLocation)

  • Implementation of the DHTML behavior script, where sLocation is an absolute or relative URL.

url(#objID)

  • Binary implementation of DHTML behavior, where objID is the ID specified in the object tag.

url(#default#behaviorName)

  • The default behavior of the application, identified by its behaviorName.

An example of its use is a component that implements the alpha transparency of PNG images for IE 5.5 and IE 6. TwinHelix Designs .

Sources:

10.12.2015 / 17:07