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

網頁設計滑鼠經過字變色

發布時間:2020-09-11 13:27:01

1、網頁設計中,當滑鼠移過字體顏色會發生變化的效果怎麼做啊

直接在CSS文件中添加一個定義鏈接就是了,在需要的地方調用,比如:

/*網站鏈接總的CSS定義:可定義內容為鏈接字體顏色、樣式等*/

a{text-decoration: underline;} /*鏈接無下劃線none,有為underline*/
a:link {color: #00007f;} /*未訪問的鏈接 */
a:visited {color: #65038e;} /*已訪問的鏈接*/
a:hover{color: #ff0000;} /*滑鼠在鏈接上 */
a:active {color: #ff0000;} /*點擊激活鏈接*/

2、html滑鼠滑過 文字變色 求最簡單的方法!!

實現滑鼠經過背景變色的方法有很多,
方法一:直接寫在HTML代碼中。
<div onmouseover="this.style.color='red'" onmouseout="this.style.color='black'">
html滑鼠滑過 文字變色
</div>

方法二:先設置固定的樣式,然後調用。

<style>
.d_over{background-color:#307172;}
.d_out{background-color:#EFEFEF;}
</style>

<div class="d_out" onmouseover="this.className='d_over'"
onmouseout="this.className='d_out'">哈哈哈哈哈</div>
方法三、使用<a>標簽。這也是常用的方式

一般<a>是用來定義鏈接的樣式的,並不是定義某個區域的。現在常用的div+css的網頁用,div就是表示區域的意思,還是喜歡用這種,當然用table的話,會有更簡單的方法。

其實現在用的較多的是用<a>標簽實現的。

<style>
a {color:red;
width:100px; height:22px; line-height:22px;}
a:hover {background:#f4f4f4;
color:#000;}
</style>

這樣只要是代連接的都會變哦,你可以在某區域用,則某區域裡面的所有來連接的都會滑鼠經過變色。
也可以直接對一個區域的a標簽寫獨立的樣式。
例如:
<div class="bs">
<a>滑鼠劃過變由紅變黑</a></div>
css中 設置:
.bs a {color:red; width:100px; height:22px; line-height:22px;}
.bs a:hover {background:#f4f4f4; color:#000;}
這樣,就不影響其他的a標簽。

3、網頁製作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>

有點亂,希望有幫助!

4、如何在網頁實現滑鼠經過文字後更改顏色?

一般我做的滑鼠經過文字後改變顏色的都是這段文字是一個鏈接 文字是鏈接的話就可以在頁面屬性里改一下 鏈接(css)這一欄 把那四個什麼什麼鏈接都改一下不一樣的顏色就可以了 樓主可以試試 要是這文字不是鏈接的話就做成圖片吧 兩張不一樣顏色文字的圖片 插入滑鼠經過圖像就可以了 其他的我就不會啦 哈哈 這個本人接觸的也少

5、如何在網頁中做滑鼠經過不同文字變不同顏色色效果

<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>

6、網頁設計中如何讓字體的顏色隨著滑鼠的移動或者滑鼠經過字體時而改變?

樣式表的運用

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

7、Dreamweaver中如何製作滑鼠經過導航欄文字變色

在你的網頁的head標簽里加入這段代碼
<style type="text/css">
<!--
body{font-size: 12px;}
a{color: #0F0; text-decoration: none; }
a:hover {color: #F00; text-decoration: none; }
-->
</style>
a是指<a></a>這段標簽
:hover是滑鼠經過時的狀態
這是css,如果還有問題可以直接問我

8、網頁中當滑鼠經過時,字體變色的代碼?

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>

9、網頁中,當滑鼠經過時,鏈接的文字變色是怎麼實現的?

a:hover
{color:#f00;}我這里寫了個紅色的值;
你可以改動,你的a
是白色,
滑過也是白色,
你給你的
a:hover
改變個顏色值
就可以看到了

10、用HTML怎麼設置:當滑鼠放在字上面的時候,字體就變色

可以將所要變色的文字放進一個標簽里,比如<p>標簽,讓後對這個標簽添加一個hover屬性,即當滑鼠停留在這個標簽上時會觸發設定好的效果。以下演示具體步驟。

1、打開一個HTML文件,添加好基本標簽並在body標簽里添加p標簽,並在p標簽里添加所要變色的文字。

2、接下來對p標簽添加css樣式,並添加hover屬性。當滑鼠懸停在p標簽上時間文字變為紅色,大小變為60px。

3、編輯好後保存在瀏覽器中執行該HTML文件,滑鼠懸停在文字上即可看到效果了。

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