What is the "behavior" attribute in CSS for?

Asked

Viewed 177 times

6

I’ve seen in some CSS codes made to work on most esteemed navigator Internet Explorer the following attribute:

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

What is the purpose of this behavior?

Only works for Internet Explorer?

  • 3

    Wow, you took that out of the bottom of the trunk.

  • Seriously @bfavaretto? I had already seen in a code and wanted to know what it was for. One day I used to make a border-Radius work in internet explorer, but never knew what is this HTC not even behavior

  • I will search to refresh the memory and be able to post a complete answer. But I already say: in the case of your example, the behavior served to make old Ies respect transparency (alpha channel) in PNG files.

  • 1

    I gave up answering, Earendul doesn’t say everything but says enough.

1 answer

3


Yes, it only works for Internet Explorer.

It’s a Microsoft extension for CSS.

What does he do?

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

Usually . Htc files, composed of HTML, scripts and HTC-specific elements.

Syntax

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

Estates

url(sLocation)

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

url(#objID)

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

url(#default#behaviorName)

  • The standard application behavior, identified by your behaviorName.

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

Sources:

  • Very large workaround in Internet explorer

  • Congratulations. Thank you for the reply ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.