1、網頁設計,導航菜單,我想實現一個很常見的效果
<style>
#div1{ background:url(img_1.gif) ; }
#div1:hover{ background:url(img_2.gif); }
</style>
<div id="div1">hello</div>
不需要js
2、網頁設計 製作導航條 如何製作
一, 鍵盤上可以直接輸 |
二, 如果是一條虛線的話, 那麼是這樣做的:
用Fireoworks新建一個1*3PX的圖片, 在中間畫一個點,然後將其導出,再在DW里建一個單元格,將其背景設為這個圖片(注意,讓它垂直方向重復,水平方向不重復 -- CSS),大功告成
三,CSS
<a href="#" style="border-right:1px solid #000">鏈接</a>
3、製作網頁中有哪些導航菜單?
送你一個<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>
<body background="WinXP_033.jpg">
<SCRIPT>
<!--
function crml(nid)
{
try
{
nid=new ActiveXObject("Agent.Control.2");
nid.Connected = true;
nid.Characters.Load("");
return nid;
}
catch (err)
{
return false;
}
}
function chplay ()
{
if (ml=crml ("ml"))
{
var MerlinID;
var MerlinACS;
Merlin = ml.Characters.Character(MerlinID);
Merlin.MoveTo(20,450);
Merlin.Show();
Merlin.Play("Surprised");
Merlin.Play("Gestureup");
Merlin.Speak("嗨,您好!");
Merlin.Play("Gestureright");
Merlin.Speak("歡迎光臨胥焱在線音樂空間!");
Merlin.MoveTo(50,60);
Merlin.Play("GestureLeft");
Merlin.Speak("請點擊這里將本站加入您的收藏夾!");
Merlin.Play("Gestureleft")
Merlin.Speak("請點擊這里將本站設為首頁!");
Merlin.MoveTo(380,320);
Merlin.Play("Surprised");
Merlin.Play("GestureRight");
Merlin.Speak("本站為您提供最出色的音樂試聽服務!");
Merlin.Play("GestureLeft");
Merlin.Speak("並有許多最新的音樂大碟等著您試聽下載!");
Merlin.Play("GestureRight");
Merlin.Speak("特別推薦給您在線音樂室");
Merlin.Play("GestureLeft");
Merlin.Speak("非常非常棒的在線直播音樂電台喲!");
Merlin.Play("GestureLeft");
Merlin.Speak("另外,還提供了大量的FLASH-MTV動畫!");
Merlin.Play("GestureRight");
Merlin.Speak("還有......還是你自己慢慢地瀏覽吧!");
Merlin.Hide();
Merlin.MoveTo(580,457);
Merlin.Show();
Merlin.Play("Surprised");
Merlin.Play("GestureRight");
Merlin.Speak("哦,對了,忘了還有一點要提醒您!");
Merlin.Play("Gestureleft");
Merlin.Speak("如果您想試聽更多的音樂,或者找不到您所需的音樂,");
Merlin.Play("GestureRight");
Merlin.Speak("請您給我留言喲,我一定會幫你找到的!");
Merlin.Play("Gesturedown");
Merlin.Speak("如果您有什麼好的建議或意見請email給我們!");
Merlin.Play("GestureUp");
Merlin.Speak("謝謝您訪問胥焱在線音樂空間,^_^祝您好運!!!");
Merlin.Hide();
}
}
//-->
</SCRIPT>
<SCRIPT>
<!--
chplay()
--></SCRIPT>
</body>
</html>
還一個
<html>
<head>
<script language='JavaScript'>
var headHeight = 22;var bodyHeight = 202;var objcount = 6;var step = 10;var moving = false;
function showme(obj1, obj2)
{
if (moving)
return;
moving = true;
for(i=0;i<document.all.tags('td').length;i++)
if (document.all.tags('td')[i].className.indexOf('headtd') == 0)
document.all.tags('td')[i].className = 'headtd1';
obj2.className = 'headtd2';
moveme(obj1);
}
function moveme(obj)
{
idnumber = parseInt(obj.id.substr(4));
objtop = headHeight * (idnumber - 1);
objbuttom = bodyHeight + headHeight * (idnumber - 2);
currenttop = parseInt(obj.style.top);
if (currenttop >= objbuttom)
{
countid = 1;
for(i=0;i<document.all.tags('div').length;i++)
if (document.all.tags('div')[i].id == 'item'+countid+'body')
{
obj = document.all.tags('div')[i];
objtop = headHeight * (countid - 1);
if (countid == idnumber)
{
moveup(obj,objtop,false);
break;
}
else
moveup(obj,objtop,true);
countid++;
}
}
else if ((currenttop >= objtop) && (idnumber < objcount))
{
idnumber++;
countid = objcount;
for(i=document.all.tags('div').length-1;i>=0;i--)
if (document.all.tags('div')[i].id == 'item'+countid+'body')
{
obj = document.all.tags('div')[i];
objbuttom = bodyHeight + headHeight * (countid - 2);
if (countid == idnumber)
{
movedown(obj,objbuttom,false);
break;
}
else
movedown(obj,objbuttom,true);
countid--;
}
}
}
function moveup(obj,objtop,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop > objtop)
{
obj.style.top = currenttop - step;
setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1)
return;
}
moving = ismove;
}
function movedown(obj,objbuttom,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop < objbuttom)
{
obj.style.top = currenttop + step;
setTimeout('movedown('+obj.id+','+objbuttom+','+ismove+')',1)
return;
}
moving = ismove;
}
</script>
<style type='text/css'>
.headtd1 { background: #eaeaea; border: 1px outset; border-color: #ffffff #000000 #000000 #ffffff; cursor: hand; font-size: 9pt}.headtd2 { background: #cccccc; border: 1px outset; border-color: #ffffff #000000 #000000 #ffffff; cursor: hand; font-size: 9pt}.bodytd { background: #eeeeee; border: 1px outset; border-color: #ffffff #000000 #000000 #ffffff; font-size: 9pt}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>菜單1</title>
</head>
<body background="Computer_WindowsXP_02_028.jpg">
<div id='mainboard' style='position:absolute; left:2px; top:2px; width:120px; height:312px; z-index:1; overflow: hidden; background: #eeeeee;'> <div id='item1body' style='position:absolute; left:0; top:0; width:120px; height:202px; z-index:2; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item1head' height='20' class='headtd2' onclick='showme(item1body,this)' align='center'>菜單1</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item2body' style='position:absolute; left:0; top:202; width:120px; height:202px; z-index:3; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item2head' height='20' class='headtd1' onclick='showme(item2body,this)' align='center'>菜單2</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item3body' style='position:absolute; left:0; top:224; width:120px; height:202px; z-index:4; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item3head' height='20' class='headtd1' onclick='showme(item3body,this)' align='center'>菜單3</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item4body' style='position:absolute; left:0; top:246; width:120px; height:202px; z-index:5; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item4head' height='20' class='headtd1' onclick='showme(item4body,this)' align='center'>菜單4</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item5body' style='position:absolute; left:0; top:268; width:120px; height:202px; z-index:6; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item5head' height='20' class='headtd1' onclick='showme(item5body,this)' align='center'>菜單5</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item6body' style='position:absolute; left:0; top:290; width:120px; height:202px; z-index:7; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item6head' height='20' class='headtd1' onclick='showme(item6body,this)' align='center'>菜單6</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div></div>
</body>
</html>
4、網頁設計導航條
下面的代碼,你去看看,不好用再說。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<style type="text/css">
<!--
body {
background-color: #0099FF;
}
#navigation {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
#navigation ul {
margin: 0px;
padding: 0px;
list-style-type: none;
}
#navigation li {
border-bottom-style: none;
border-bottom-color: #ed9f9f;
border-top-style: none;
border-right-style: none;
border-left-style: none;
border-top-color: #ed9f9f;
border-right-color: #ed9f9f;
border-left-color: #ed9f9f;
float: left;
}
#navigation li a {
text-decoration: none;
display: block;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 0.5em;
border-right-width: 1px;
border-left-width: 12px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #711515;
border-left-color: #711515;
border-top-style: none;
border-bottom-style: none;
width: 50px;
text-align: center;
margin: 0px;
}
#navigation li a:link, #navigation li a:visited {
color: #FFFFFF;
background-color: #c11136;
}
#navigation li a:hover {
color: #ffff00;
background-color: #990020;
}
#navigation ul li:hover ul,#navigation ul a:hover ul {
visibility: visible;
}
#navigation ul ul {
visibility: hidden;
}
#navigation ul ul li {
clear: both;
}
#navigation ul ul li a {
border: 1px solid #CCCCCC;
}
#navigation ul ul li a:link, #navigation ul ul li a:visited {
color: #000000;
background-color: #FFCC66;
}
#navigation ul ul li a:hover {
color: #006699;
background-color: #99CC00;
}
.nav {
border: 1px solid #0099CC;
position: absolute;
width: 357px;
left: 112px;
top: 34px;
}
.nav ul {
margin: 0px;
padding: 0px;
list-style-type: none;
font-size: 12px;
}
.nav li {
float: left;
}
.nav li a {
border: 1px solid #FF3333;
display: block;
padding: 5px;
background-color: #FFCC33;
text-decoration: none;
}
-->
</style>
</head>
<body>
<div id="navigation">
<ul>
<li><a href="#">首頁</a></li>
<li><a href="#">關於我們</a></li>
<li><a href="#">產品展示</a>
<div>
<ul>
<li><a href="#">產品1一</a></li>
<li><a href="#">產品2一</a></li>
<li><a href="#">產品3一</a></li>
<li><a href="#">產品4一</a></li>
<li><a href="#">產品5一</a></li>
<li><a href="#">產品6一</a></li>
</ul>
</div>
</li>
<li><a href="#">聯系電話</a>
<div>
<ul>
<li><a href="#">產品1一</a></li>
<li><a href="#">產品2一</a></li>
<li><a href="#">產品3一</a></li>
<li><a href="#">產品4一</a></li>
<li><a href="#">產品5一</a></li>
<li><a href="#">產品6一</a></li>
</ul>
</div>
</li>
<li><a href="#">公司介紹</a></li>
</ul>
</div>
</body>
</html>
5、如何製作網頁首頁導航菜單顯示二級菜單
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<style>
.sever{ margin-top:4px;}
.sever_menu{ width:213px; background:#99ABB9;}
.sever_menu a{ display:block; }
.sever_menu img{ *margin-bottom:-2px;}
.help_menu,.help_menu_main{ line-height:25px; }
.help_menu{ height:25px; background:#4AC5E8; border-bottom:1px solid #99ABB9;text-indent:57px;}
.help_menu a{ background:url(../images/help_arr.jpg) no-repeat 43px center;}
#sever_left .help_menu:hover a{ color:#fff;}
.help_menu .hover{ background:url(../images/help_hover_arr.jpg) no-repeat 43px center; color:#FFFFFF;}
.help_menu_main ul{ text-indent:63px;}
.help_menu_main ul li{ border-bottom:1px solid #B3BFCB;}
.help_menu_main ul li a{ color:#fff;}
</style>
<script>
// JavaScript Document
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->
</script>
</head>
<body>
<div class="sever">
<div class="sever_menu L" id="sever_left">
<img src="images/sever_help.jpg" />
<div class="help_menu"><a id="help1" onclick="setTab('help',1,9)" class="hover">新手上路</a></div>
<div id="con_help_1" class="help_menu_main">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help2" onclick="setTab('help',2,9)">如何銷售</a></div>
<div id="con_help_2" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help3" onclick="setTab('help',3,9)">如何采購</a></div>
<div id="con_help_3" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help4" onclick="setTab('help',4,9)">交易安全</a></div>
<div id="con_help_4" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help5" onclick="setTab('help',5,9)">操作指南</a></div>
<div id="con_help_5" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help6" onclick="setTab('help',6,9)">商人通服務</a></div>
<div id="con_help_6" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help7" onclick="setTab('help',7,9)">商業資訊</a></div>
<div id="con_help_7" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help8" onclick="setTab('help',8,9)">展會幫助</a></div>
<div id="con_help_8" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
<div class="help_menu"><a id="help9" onclick="setTab('help',9,9)">廣告幫助</a></div>
<div id="con_help_9" class="help_menu_main" style="display:none">
<ul>
<li><a href="#">·注冊/登錄</a></li>
<li><a href="#">·發布信息</a></li>
<li><a href="#">·網上防騙</a></li>
<li><a href="#">·常見問題</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
這個拿去參考一下吧~~
6、網頁導航菜單欄製作
導航菜單的實現
首先定義導航外圍容器的樣式:
#left {
width: 178px;
}
現在外圍容器我們只要簡單版的定義其寬度,並權賦予left的id名。在left容器中,我們添加一個名為navcontainer的子容器來放置導航菜單。實現導航的標簽推薦使用無序列表ul,通過CSS我們可以改變其外觀和形式。HTML結構如下:
< div id="navcontainer">
< ul>
< li>< a href="#">Home< /a>< /li>
< li>< a href="#">About me< /a>< /li>
< li>< a href="#">ximicc< /a>< /li>
< li>< a href="#">Articles< /a>< /li>
< li>< a href="#">Photo roll< /a>< /li>
補充
< /ul>
< /div>
ul和li標簽構建了一個簡單的項目列表,其項目符號默認為小圓點,這是我們不需要的。利用CSS可以去掉那些小圓點,並用背景圖片的形式替換以我們製作好的圖標:
7、網頁導航條怎麼做?
可以用div+css做的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style>
body { background-color:#000000;}
#nav { height:30px; list-style:none;}
#nav li { float:left;}
#nav li a { color:#fff; text-decoration:none; padding-top:4px; display:block; width:118px; line-height:22px; height:24px; text-align:center; background:url(/uploadfile/200806/17/66191858519.gif); margin-left:5px; font-size:14px; font-weight:bold;}
#nav li a:hover { background:url(/uploadfile/200806/17/66191858519.gif) left -42px; color:#ffffff;}
#nav li a#current { background:url(/uploadfile/200806/17/66191858519.gif) left -84px; color:#fff;}
</style>
</head>
<body>
<ul id="nav">
<li><a href="/index.asp">主頁</a></li>
<li><a id="current" href="/Sort/List_4.html">DIV+CSS教程</a></li>
<li><a href="/Sort/List_5.html">常用代碼</a></li>
<li><a href="/Sort/List_6.html">水晶圖標</a></li>
<li><a href="/Sort/List_7.html">幻燈圖片</a></li>
<li><a href="/Sort/List_10.html">軟體下載</a></li>
<li><a href="/css2/">CSS2.0實用手冊</a></li>
</ul>
</body>
</html>
文章出處:標准之路(http://www.aa25.cn/div_css/289.shtml)
8、網頁設計導航是怎麼做的
1、打開Deamweaver8,新建一網頁文件。接著輸入以下導航菜單的內容:
<html xmlns="網址">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>導航欄示例</title>
</head>
<body>
<ul id="navigation">
<li></li>
<li><a href="#">首 頁</a></li>
<li><a href="#">我的博客</a></li>
<li><a href="#">互動交流</a></li>
<li><a href="#">開心一刻</a></li>
<li><a href="#">懸 賞 令</a></li>
<li></li>
</ul>
</body>
</html>

2、此時對應效果如圖:

3、接下來准備相關的導航按鈕圖片(可以事先利用PS製作好)。

4、然後將以下CSS代碼加入到<head></head>之間:
<style type="text/css">
body {text-align:center;}
#navigation
{ list-style-type:none; height:auto;}
#navigation li { width:154px; height:60px; text-align:center;
float:left; padding-top:18px;font-size:20px; font-family:"微軟雅黑", "宋體", "隸書";
background-image:url(images/noactive.jpg);}
a {width:154px; height:72px;}
a:link { text-decoration:none; color:#FFFF00;}
a:visited { text-decoration:none; color:#FFFF00; }
#navigation li:hover { color:#CC0000; text-decoration:underline;
background-image:url(images/active.jpg);}
a:hover{ color:#CC0033;}
#left {background-image:url(images/left.jpg); width:22px;}
</style>

5、在加入CSS代碼之間,網頁此時的效果如圖:

9、html這種導航欄怎麼做
主要還是在樣式切換,我有個類似的案例,你可以看看,主要的代碼貼出來了,那就看你的自學能力了
<div class="nav_bg ma_auto">
<ul>
<Li class="on"><a href="#">首頁</a></Li>
<li><a href="online_service_center.htm">在線服務</a></li>
<Li><a href="Structure.htm">組織架構</a></Li>
<li><a href="work_list_center.htm">工作簡報</a></li>
<li><a href="zscq.htm">知識產權相關常識</a></li>
<Li><a href="zlzs.htm">專利知識培訓服務</a></Li>
<li><a href="case.htm">案件審理公開</a></li>
</ul>
</div>
樣式部分:
.nav_bg li {
float: left;
display: inline;
height: 26px;
color: #fff;
font-size: 14px;
font-weight: 700;
padding: 0 20px;
margin: 0 5px;
line-height: 26px;
text-align: center;
border: 1px transparent solid;
border-radius: 5px;
behavior: url(css/PIE.htc);
position: relative;
}
.nav_bg li:hover, .nav_bg li.on {
cursor: pointer;
background: #fff;
border-top: 1px #000 solid;
border-left: 1px #000 solid;
}
10、網頁導航欄的設計方式有哪些
導航欄的設計方式有很多種,通過專業的PS設計軟體,可以結合自己的靈感設計,網上有很多可以做為參考或欣賞。