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

網頁設計滑鼠經過後變色

發布時間:2020-09-19 08:34:17

1、網頁製作代碼,滑鼠放在導航欄上變色那種,

<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 瀏覽器打開

2、DW製作網頁導航欄如何設置滑鼠經過時背景顏色會改變?

使用偽類 :hover{background-color:#f00;}
例如你要給一個div 標簽設置滑鼠懸浮上去改變背景,
css樣式:
.box{background-color:#0f0;} //設置div的背景顏色
.box:hover{background-color:#f00;} //設置滑鼠懸浮上去時的背景意思
html內容:
<div class="box">滑鼠懸浮改變背景</div>

3、急!dreamweaver怎麼製作滑鼠經過文字字體變色效果

1、做好一個鏈接

2、點擊工具面板中CSS模式下的「+」,打開新建CSS樣式面板

3、選擇「復合內容」,選擇a:link,表示正常鏈接時的樣式。

4、點擊確定,打開樣式設置面板,選擇Color:#333,或別的你要的著色,確定。

5、下面設置滑鼠經過的文字色彩,還是參考第二步,打開新建CSS規則面板,選擇「復合內容」,選擇器中選擇:a:hover,

6、color中選擇滑鼠經過的顏色,這里以「#F00」即紅色為例。確定。

7、下面看一下效果,完畢。

4、DW製作網頁導航欄如何設置滑鼠經過時背景顏色改變?

<table width="300" border="0" cellspacing="10" cellpadding="0" bgcolor="#9966FF">
<tr>
<td bgcolor="#0066FF" onmouseover="this.style.background='#FF0000'" onmouseout="this.style.background='#0066FF'" > </td>
<td bgcolor="#0066FF" onmouseover="this.style.background='#FF0000'" onmouseout="this.style.background='#0066FF'"> </td>
<td bgcolor="#0066FF" onmouseover="this.style.background='#FF0000'" onmouseout="this.style.background='#0066FF'"> </td>
</tr>
</table>

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

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

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

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

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

有點亂,希望有幫助!

8、網頁製作中 當滑鼠放在button按鈕上時 按鈕顏色改變 如何實現?

插入代碼<button onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" >button</button>即可實現。

9、網頁製作滑鼠經過變色

<html>
<head><title>滑鼠經過鏈接文字變色</title>
</head>
<body>
<a href=http://www.acbi.com.cn/ style="color='red';cursor:hand" onmouseover="javascript:this.style.color='yellow'"
onmouseout="javascript:this.style.color='red'">滑鼠經過鏈接文字變色</a>
</body>
</html>

這個是滑鼠經過文字時,文字變色的代碼,希望能幫到你

10、網頁設計中,怎樣可以當滑鼠經過一個圖片時,會發生顏色變化

把圖片做成元件..影片或按鈕元件都行..

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