導航:首頁 > 萬維百科 > 網頁設計滑鼠變色

網頁設計滑鼠變色

發布時間: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 瀏覽器打開

與網頁設計滑鼠變色相關的知識