I was surfing and saw this css property which I have never seen or used before. I think it is related to Internet Explorer, and the structure is something like this:
#element{
behavior: url(something.htc);
}
What does the behavior
property do? How would I use this property?
I did find this w3 Documentation, but it's not particularly clear what it does.
url() The url() CSS function is used to include a file. The parameter is an absolute URL, a relative URL, a blob URL, or a data URL. The url() function can be passed as a parameter of another CSS functions, like the attr() function.
The property is the color piece of this declaration. It dictates which aspect of the selector will be changed visually. The value is what the chosen CSS property will be changed to. In our example, we are using the hex value of #000, which is CSS shorthand for "black."
Usage is simple — you insert the path to the image you want to include in your page inside the brackets of url() , for example: background-image: url('images/my-image. png'); Note about formatting: The quotes around the URL can be either single or double quotes, and they are optional.
htc files are commonly used in . css files using an IE specific property called behavior, using this along with the . htc file allows the browser to run JavaScript code which is whats contained within the file.
.htc files are commonly used in .css files using an IE specific property called behavior, using this along with the .htc file allows the browser to run JavaScript code which is whats contained within the file.
Sets or retrieves the location of the Dynamic HTML (DHTML) behaviorDHTML Behaviors.
The script resides in an HTC (HTML Component) file. HTC files have the extension .htc, and are HTML files that contain a script plus a set of HTC-specific elements that define the components.
behavior: url(sLocation) | url(#objID) | url(#default#behaviorName)
url(sLocation)
url(#objID)
url(#default#behaviorName)
It lets you use CSS to attach a script to a specific element in order to implement DHTML (Dynamic HTML) components.
Internet Explorer versions 5 and later support the behavior property. Internet Explorer 8 supports Vendor specific format of -ms-behavior
For more info. refer this link.
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