现在网页上的超链接标题的颜色的问题?急!!

来源:百度知道 编辑:UC知道 时间:2024/05/21 16:11:01
比如一开始的超链接颜色是黑色 ,但是鼠标移动到标题的时候颜色变成红色

这是怎么实现的 是用的CSS 还是 Javascript 能仔细说一下码??最好有代码
http://ent.sina.com.cn/v/m/2008-05-01/12052010834.shtml

大家看一下这个网页 是新浪网的 之前超链接的颜色是蓝色的 当鼠标移动到超链接的时候颜色就变成了红色

这个写代码能做到吗?

<style type="text/css">
A.style2:link {
text-decoration: underline; //有下划线,改为none就没有了
color:#ff3322; //超连接的颜色
font-weight: normal;
}
A.style2:visited {
text-decoration: underline; //同上
color: #000000; //已经访问过的连接的颜色
font-weight: normal;
}
A.style2:active {
text-decoration: none;
color: #00ff00; //如果地址有效的时候的颜色
font-weight: normal;
}
A.style2:hover {
text-decoration: none;
color: #0000ff; //你的鼠标经过地址的时候的颜色
font-weight: normal;
}
</style>
<a href="http://www.baidu.com/" class="style2">第二个链接</a>

把这些代码保存为test.html,然后打开就知道效果了。

阅读 html <A> 的样式说明

那是浏览器要做的事,与你写程序没有关系