上面的 HTML 文件中有一个 <style> 元素,它为 <h1> 元素界说了一个举止:
<html> <head> <style type="text/css"> h1 { behavior: url(behave.htc) } </style> </head> <body> <h1>Mouse over me!!!</h1> </body> </html>
下面是 XML 文档 "behave.htc":
<attach for="element" event="onmouseover" handler="hig_lite" /> <attach for="element" event="onmou搜索引擎优化ut" handler="low_lite" /> <script type="text/javascript"> function hig_lite() { element.style.color='red'; } function low_lite() { element.style.color='blue'; } </script>
behavior 文件包孕了针对元素的 JavaScript 与 事故句柄。
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css-tool/t52907.shtml