gpt4 book ai didi

css - 什么是行为 : url(); property in css?

转载 作者:技术小花猫 更新时间:2023-10-29 10:13:19 24 4
gpt4 key购买 nike

我在网上冲浪时看到了这个我以前从未见过或使用过的 css 属性。我认为它与 Internet Explorer 有关,结构是这样的:

#element{
behavior: url(something.htc);
}

behavior 属性有什么作用?我将如何使用此属性?

我确实找到了这个 w3 Documentation , 但它的作用并不是特别清楚。

enter image description here

最佳答案

Microsoft 对 CSS 的扩展

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

它有什么作用?

设置或获取 Dynamic HTML (DHTML) behaviorDHTML Behaviors 的位置.

.htc 扩展名

脚本驻留在 HTC(HTML 组件)文件中。 HTC 文件的扩展名为 .htc,是包含脚本和一组定义组件的 HTC 特定元素的 HTML 文件。

- History of behavior


语法

行为:url(sLocation) |网址(#objID) |网址(#default#behaviorName)

属性值

网址(sLocation)

  • DHTML 行为的脚本实现,其中 sLocation 是绝对或相对 URL。

网址(#objID)

  • DHTML 行为的二进制实现,其中 objID 是对象标记中指定的 ID 属性。

url(#default#behaviorName)

  • 应用程序的默认行为,由其行为名称标识。

有用的链接

Microsoft says it is no longer supported in IE 10!

关于css - 什么是行为 : url(); property in css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26339276/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com