关于网页代码(CSS和 HTC元件)

来源:百度知道 编辑:UC知道 时间:2024/05/09 11:49:24
1.CSS样式 是不是能把任意代码加载到网页中? 一段CSS代码能否加载到网页中的任何标签<></>中? 能实现的功能是不是有限的?

2.一个HTC元件 实例问题!
◆渐变连接特效◆
步骤一、下载htc元件放於网页同一目录下 (已放在同一目录)
HTC元件的内容:
<public:component>
<public:attach event="onmouseover" onevent="domouseover()">
<public:attach event="onmouseout" onevent="domouseout()">
<script language="javascript">
function domouseover(){
with(element)
{filters.item(0).Apply();filters.item(0).Play();}}
function domouseout(){
with(element){
filters.item(0).Apply();
filters.item(0).Play();}}
</script>
</public:component>

步骤二、复制语法贴於<head></head>之间 (代码也放对的)
<style type=text/css>
<!--
a {cursor:hand; height:1; behavior: url(../effect.htc); filter:progid:dximagetransform.microsoft.gradientwipe(duration=1);text-decoration : none ; }
a:link { color :

代码可行,我已经试过

请仔细检查以下两处地方

1.HTC的文件名要和CSS中这一句中的文件名保持一致。

a {cursor:hand; height:1; behavior: url(../effect.htc);

本例中文件名应该是effect.htc

2.检查CSS代码中HTC文件的路径是不是和你放置位置对应。

如果放到和网页同一目录下那么路径应该是

a {cursor:hand; height:1; behavior: url(effect.htc);

如果加上../就表示当前文件夹往上一层的文件。