大家能告诉我这个效果怎样在代码里实现吗?

来源:百度知道 编辑:UC知道 时间:2024/09/23 23:45:14
我做的一个网页页面,里面有一个1行8列的导航栏,分别链接8个子页面,当我鼠标移动到某个标题,如"课程简介"的时候,我想让它的字体颜色发生变化,即鼠标移过字体颜色发生变化,怎样在代码中实现啊?

给标题的那个控件追加onmouseover,onmouseout事件,事件里面控制字体颜色变化,使用方法同onclick一样!

在CSS里设置
A//普通
{
font-size: 12px;
direction: ltr;
line-height: normal;
letter-spacing: normal;
text-align: center;
text-decoration: none;
color: #004e4d;
}

A:visited//访问过
{
color: purple;
font-family: 宋体;
text-decoration: true;
}
A:active
{
font-family: 宋体;
text-decoration: none;
color: #004080;
}
A:hover//鼠标移上去时
{
text-decoration: none;
border-left-width: 1;
border-right-width: 1;
border-top-width: 1;
font-weight: bold;
cursor: hand;
}
上面就是超连接的样式

仅仅是字体颜色发生变化,luanyingfei 回答的很对,

如果要求背景图片也要变化的话,liuyi2311 回答的对,