导航:首页 > 万维百科 > 网页设计鼠标变色

网页设计鼠标变色

发布时间:2020-11-24 09:04:58

1、网页设计中如何让字体的颜色随着鼠标的移动或者鼠标经过字体时而改变?

样式表的运用

中添加代码
a:link
{
//鼠标未经过时也就是网页显示的颜色
color:darkgreen;
text-decoration:none;//不显示下划线
}
a:hover
{
//鼠标经过时也就是点击时颜色
color:red;
position:relative;
top:1px;
//鼠标经过时让链接的文字上移一像素(动态效果就在这)
text-decoration:none;
}
a:visited
{
//鼠标经过后也就是点击链接后的颜色
color:blue;
position:relative;
top:1px;
text-decoration:none;
}

2、如何在网页实现鼠标经过文字后更改颜色?

一般我做的鼠标经过文字后改变颜色的都是这段文字是一个链接 文字是链接的话就可以在页面属性里改一下 链接(css)这一栏 把那四个什么什么链接都改一下不一样的颜色就可以了 楼主可以试试 要是这文字不是链接的话就做成图片吧 两张不一样颜色文字的图片 插入鼠标经过图像就可以了 其他的我就不会啦 哈哈 这个本人接触的也少

3、网页制作中 当鼠标放在button按钮上时 按钮颜色改变 如何实现?

插入代码<button onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" >button</button>即可实现。

4、如何在网页中做鼠标经过不同文字变不同颜色色效果

<html>
<head>
<style>
a.ji{color: blue; }
a.jl:hover{color: red}

a.un{text-decoration : none }
a.un:hover{text-decoration: underline;}

a.com{color="white"}
a.com:hover{color:black;}

</style>
</head>
<body>
<a href="" class="jl">个人简历</a><br><br><br><br>
<a href="" class="com">公司简介</a><br><br><br><br>
<a href="" class="un">我有下划线哦</a><br>
</body>
</html>

5、网页中当鼠标经过时,字体变色的代码?

onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''
随便套用:
<tr onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''>

<td onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''>

<a onMouseOver=this.style.backgroundColor='#DCECF4'; onMouseOut=this.style.backgroundColor=''>xxxxxxx</a>

6、网页制作javascript鼠标经过文字变色问题

<style type="text/css">
body,td,th {
font-size: 18px;
color: #999;
font-weight: bold;
}

上面已经设置了td,th文字颜色属性,

<td width="62"><div align="center"><a href=page1.html style="color='#999';cursor:hand" onmouseover="javascript:this.style.color='red'" 
onmouseout="javascript:this.style.color='#999'">游戏介绍</a></div></td>

这里又设置了颜色属性,不过行内样式优先,可以改成style="color=blue;............",这时即:

<style type="text/css">
body,td,th {
font-size: 18px;
color: #999;
font-weight: bold;
}<td width="62"><div align="center"><a href=page1.html style="color='blue';cursor:hand" onmouseover="javascript:this.style.color='red'" 
onmouseout="javascript:this.style.color='#999'">游戏介绍</a></div></td>

这时颜色body,td,thcolor属性已经不起作用了也可以下面这样,去掉行内style="color:#999",行内的color属性去掉 前边color设置成你要的其实颜色。

<style type="text/css">
body,td,th {
font-size: 18px;
color: blue;
font-weight: bold;
}
<td width="62"><div align="center"><a href=page1.html style="cursor:hand" onmouseover="javascript:this.style.color='red'" 
onmouseout="javascript:this.style.color='#999'">游戏介绍</a></div></td>

有点乱,希望有帮助!

7、网页设计中,当鼠标移过字体颜色会发生变化的效果怎么做啊

直接在CSS文件中添加一个定义链接就是了,在需要的地方调用,比如:

/*网站链接总的CSS定义:可定义内容为链接字体颜色、样式等*/

a{text-decoration: underline;} /*链接无下划线none,有为underline*/
a:link {color: #00007f;} /*未访问的链接 */
a:visited {color: #65038e;} /*已访问的链接*/
a:hover{color: #ff0000;} /*鼠标在链接上 */
a:active {color: #ff0000;} /*点击激活链接*/

8、网页设计中,怎样可以当鼠标经过一个图片时,会发生颜色变化

把图片做成元件..影片或按钮元件都行..

9、网页制作代码,鼠标放在导航栏上变色那种,

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<div style="width:100px; height:30px; border:1px solid #cecece; line-height:30px; text-align:center;" onmouseover="this.style.background='#ff0000'" onmouseout="this.style.background=''">学院简介</div>

复制以上代码保存为html 浏览器打开

与网页设计鼠标变色相关的知识