導航:首頁 > 萬維百科 > 網頁設計滑鼠經過文字顯示

網頁設計滑鼠經過文字顯示

發布時間: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、看下更改顏色後的效果

與網頁設計滑鼠經過文字顯示相關的知識