导航:首页 > 万维百科 > 网页设计鼠标经过文字显示

网页设计鼠标经过文字显示

发布时间:2020-11-19 07:58:14

1、html网页中 如何 鼠标经过图片 然后旁边显示字体 或者 在另外一个模块内显示内容

使用div css实现鼠标悬停图片上方时显示文字内容原理:
首先我们设置一个盒子对象,并且将图片使用style标签内设置为CSS背景图片,同时设置该对象html a超链接display:none隐藏,该超链接锚文本内放好文字内容,最后设置鼠标悬停经过整个对象时候显示超链接内容。
需要注意是,我们使用了css position绝对定位超链接a标签位于该盒子对象下方,并且为了美化效果给html a标签宽度与对象宽度相同,设置一定高度,设置css背景为半透明背景颜色。
同时为了兼容IE6我们使用了IE6支持hover插件。控制阅读了解ie6 hover支持。本效果兼容各大浏览器包括IE6。
打包源代码请下载附件,谢谢

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>鼠标悬停图片上显示文字 在线演示

<style>
img{border:0}/* css 注释说明:设置图片边框为0 */
body{behavior:url("csshover.htc");text-align:center;}/* css注释说明:兼容ie6 支持标签使用hover */
.divcss5{ position:relative;width:554px; height:346px;margin:0 auto}
.divcss5 a,.divcss5 span{display:none; text-decoration:none}
.divcss5:hover{cursor:pointer}
.divcss5:hover a.now{cursor:pointer; position:absolute; top:0; width:<a href="https://www.baidu.com/s?wd=100%25&tn=44039180_cpr&fenlei=_5y9YIZ0lQzqlpA-" target="_blank" class="baidu-highlight">100%</a>; height:<ahref="https://www.baidu.com/s?wd=100%25&tn=44039180_cpr&fenlei=_5y9YIZ0lQzqlpA-" target="_blank" class="baidu-highlight">100%</a>;
z-index:100; left:0; display:block;}
.divcss5:hover span{ display:block;position:absolute; bottom:0; left:0;color:#FFF;width:554px;
z-index:10;height:36px; line-height:36px; background:#000;filter:alpha(opacity=60);-moz-opacity:0.5;opacity: 0.5;}
/* 设置显示文字定位位置,背景半透明 */

</style>
</head>
<body>

<div class="divcss5" style="background:url(imgexp.png)">
<span>文字内容</span>
<a href="#" class="now"> </a>
</div>

<div class="divcss5" style="background:url(imgexp.png)">
<span>欢迎访问DIVCSS5网站</span>
<a href="

</div>

</body>
</html>

2、网页制作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>

有点乱,希望有帮助!

3、dreamweaver中,鼠标经过文字显示说明

在DW的状态栏选中你要显示说明的表格或单元格,然后在右边选择标签-->属性-->CSS/辅助功能-->title-->单击Title后面的空白处填写你要的注释文字
谢谢采纳

4、html如何实现鼠标悬停显示文字,鼠标移走文字消失。

1、方法一,利用html特性,每个标签都有一个title属性。当鼠标hover在该标签内容上时,浏览器展示出该标签的title内容,让鼠标移走,内容消失,如下:

div{

height:100px;

width:100px;

background-color: aqua;

}

<div title="我是鼠标悬停展示的内容">文字内容文字内容</div>

2、方法二,利用css的伪类hover,以及显示隐藏属性display,来实现如下:

.continer{

height:100px;

width:100px;

background-color: aqua;

}

.continer div{

display:none;/*默认隐藏*/

}

.continer:hover div{

display:initial;/*当鼠标hover时展示*/

}

<div class="continer">

文字内容文字内容

<div>我是鼠标悬停展示的内容</div>

</div>

(4)网页设计鼠标经过文字显示扩展资料:

1、鼠标悬停会触发的一系列:

1)css伪类,:hover为鼠标悬停时触发的伪类,可利用该伪类实现,背景色,颜色,字体,边框,动画,过渡效果等元素属性的变化。

2)js当鼠标悬停,会触发mouseover事件。可在事件回调函数中处理对应的逻辑。

2、关于html标签title属性的作用:多用来完全展示hover的元素的内容,有些页面标题等内容过多会加省略号,而无法看到全部内容,会用到title。

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

样式表的运用

中添加代码
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;
}

6、html 在一个超链接上面,鼠标移动上去时,也显示一串文字,如何实现

html中超链接使用“href标签”上面的文字使用“title标签”,使用方式如下:

<a href="超链接内容" target="点击超链接的弹出方式" title="悬浮文字,就是你鼠标放上去想要的内容">页面上超链接的显示</a>

示例如下:

=======================

<html>

<head>

<meta charset="UTF-8">

<title>Html的超链接悬浮文字</title>

</head>

<body>

<a href="http://.baidu.com/" target="_blank" title="转至百度知道">我是一个超链接,鼠标放上来能看到什么?</a>

</body>

</html>

=========================

(6)网页设计鼠标经过文字显示扩展资料:

超级链接在本质上属于一个网页的一部分,它是一种允许我们同其他网页或站点之间进行连接的元素。各个网页链接在一起后,才能真正构成一个网站。

超链接是指从一个网页指向一个目标的连接关系,这个目标可以是另一个网页,也可以是相同网页上的不同位置,还可以是一个图片,一个电子邮件地址,一个文件,甚至是一个应用程序。

7、网页制作鼠标经过文字显示图像。

如果是静态页面的话,很好做。

也就是添加一个“层”(把你需要显示的图片放在层中),然后为你的关键字添加“行为--显示和隐藏”,可以选择鼠标的多种动作,比如可以选择当鼠标滑过的时候,显示层等等。

8、HTML 鼠标文字上 显示文字

在你好字上加入 标签 alt="你好"属性
如:比如加入一个图片,嗯在图片后面加入altalt="你好"属性,当鼠标移到上面时就 会显示 你好 字样

9、html javascript 鼠标经过显示文字信息

试试用这种方式:在一张图上划出几个区域,响应鼠标事件,从服务器端取出result显示出来,各区域的区分用ID号
<img src="01.jpg" border="0" usemap="#planetmap" />
<map name="planetmap" id="planetmap">
<area shape="circle" id="hot001" class="hot" coords="100,100,50" href ="venus.html" alt="Venus" />
<area shape="circle" id="hot002" class="hot" coords="200,200,50" href ="venus1.html" alt="Venus" />
</map>
<script language="javascript" type="text/javascript" >
$(document).ready(function () {
$(".hot").mouseover(function () {
$.get("服务器地址", { "data": $(this).id }, function (result) {
$(this).attr("alt", result);
})
})
$(".hot").mouseout(function () {
$(this).attr("alt", "");
})
})
</script>

10、网页制作中的--鼠标经过文字?

步骤:
1、打开dw软件,新建一个文档。
2、在dw当中,写入以下css样式:
<style>
.mengsb{width:648px;margin:0px auto ;}
.jixing1 a{ position:relative;width:320px;margin:0 0px 0 0;float:left;height:232px;}
.jixing1 li{width:320px;float:left;margin:2px;display:block;list-style:none;}
.jixing1 li img{width:320px}
.jixing1 a:hover{text-decoration:none;cursor:hand;}
.jixing1 a span{display:none;cursor:hand;text-align:center;color:#FFF;line-height:36px;padding:98px 0;font-weight:bold;}
.jixing1 a:hover span{width:320px;background:#000;display:block;position:absolute;bottom:0px;left:0;color:##FFF;filter:alpha(opacity=60);-moz-opacity:0.6;opacity:0.6;align:center;}
</style>
3、然后在body当中加入以下图片,代码为:
<body>
<div class="mengsb">
<div class="jixing1"><li><a href="#"><img alt="河卵石" src="file:///C|/Users/Administrator/Desktop/20151221.jpg" /><span>物料花岗岩</span></a></li>
<li><a href="#"><img alt="河卵石" src="file:///C|/Users/Administrator/Desktop/2015122101.jpg" /><span>物料花岗岩</span></a></li>
</div></div>
</body>
4、在实时视图中看下最后的效果。
5、另外我们可以改变一些参数来实现不同的效果,我们可以换不同的背景颜色。
6、看下更改颜色后的效果

与网页设计鼠标经过文字显示相关的知识