|
可以用JS实现<SCRIPTlanguage=javascript1.2>functionshowsubmenu(sid){whichEl=eval('submenu'+sid);if(whichEl.style.display=='none'){eval("submenu"+sid+".style.display='';");}else{eval("submenu"+sid+".style.display='none';");}}</SCRIPT>display方法的值为none时,为不显示表格内容showsubmenu(sid)中的sid为HTML代码中表格中td的id属性值=====================代码实现过程================<HTML><HEAD><TITLE>管理导航菜单</TITLE><SCRIPTlanguage=javascript1.2>functionshowsubmenu(sid){whichEl=eval('submenu'+sid);if(whichEl.style.display=='none'){eval("submenu"+sid+".style.display='';");}else{eval("submenu"+sid+".style.display='none';");}}</SCRIPT></HEAD><BODY><TABLEwidth=158align=center><TBODY><TR><TDid=menuTitle1style="CURSOR:hand"onclick=showsubmenu(1)height=25;><spanclass="glow">导航一</span></TD></TR><TR><TDheight="100%"id=submenu1style="DISPLAY:none"><DIVstyle="WIDTH:158px"><TABLEcellSpacing=0cellPadding=0width=132align=center><TBODY><TR><TDheight=20>1</TD></TR><TR><TDheight=20>2</TD></TR></TBODY></TABLE></DIV><DIVstyle="WIDTH:158px"><TABLEcellSpacing=0cellPadding=0width=130align=center><TBODY><TR><TDheight=20></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE><TABLEwidth=158align=center><TBODY><TR><TDid=menuTitle3style="CURSOR:hand"onclick=showsubmenu(3)height=25;><SPANclass=glow>导航二</SPAN></TD></TR><TR><TDid=submenu3style="DISPLAY:none"><DIVstyle="WIDTH:158px"><TABLEcellSpacing=0cellPadding=0width=132align=center><TBODY><TR><TDheight=20>3</TD></TR><TR><TDheight=20>4</TD></TR></TBODY></TABLE></DIV><DIVstyle="WIDTH:158px"><TABLEcellSpacing=0cellPadding=0width=130align=center><TBODY><TR><TDheight=20></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></BODY></HTML>动态导航反正我知道有用FLASH的PS虽然有这个功能但是不常用也不方便还是用PS作效果吧本回答由网友推荐这段代码比较经典的下拉菜单,不过没有美化,自己要美化的话,对列的项aa:hover的属性进行定义即可,比如定义一个好的背景等。<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"""><htmlxmlns=""><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>无标题文档</title><styletype="text/css">*body#nav#navli#navlia#navlia:hover#navliul#navli.showul#navli.showulli#navli.showullia#navli.showulul#navlili.showul</style><scripttype="text/javascript">functiongetCss(elem,property){if(elem.style[property]){returnelem.style[property];}elseif(elem.currentStyle){returnelem.currentStyle[property];}elseif(document.defaultView&&document.defaultView.getComputedStyle){property=property.replace(/([A-Z])/g,'-$1').toLowerCase();vars=document.defaultView.getComputedStyle(elem,'');returns&&s.getPropertyValue(property);}else{returnnull;}}window.onload=function(){varobj=document.getElementById("nav");varlis=obj.getElementsByTagName("li");vararr=newArray();varuls=obj.getElementsByTagName("ul")[0];for(vari=0;i<lis.length;i++){if(lis[i].className.indexOf("firstLevel")>=0){arr.push(lis[i]);}}for(vari=0;i<lis.length;i++){lis[i].style.width=obj.offsetWidth/arr.length-1+"px";if(lis[i].className.indexOf("thirdLevel")>=0){lis[i].parentNode.style.marginLeft=obj.offsetWidth/arr.length-1+"px";lis[i].parentNode.style.marginTop=-parseInt(getCss(uls,"lineHeight"))+"px";}lis[i].onmouseover=function(){this.className+=(this.className.length>0?"":"")+"show";}lis[i].onmouseout=function(){this.className=this.className.replace(newRegExp("(?|^)show\\b"),"");}}}</script></head><body><ulid="nav"><liclass="firstLevel"><ahref="#">一级栏目</a><ul><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li><li><ahref="#">二级栏目</a></li><li><ahref="#">二级栏目</a></li></ul></li><liclass="firstLevel"><ahref="#">一级栏目</a><ul><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li></ul></li><liclass="firstLevel"><ahref="#">一级栏目</a><ul><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li></ul></li><liclass="firstLevel"><ahref="#">一级栏目</a><ul><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li></ul></li><liclass="firstLevel"><ahref="#">一级栏目</a><ul><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li><li><ahref="#">二级栏目</a><ul><liclass="thirdLevel"><ahref="#">三级栏目</a></li></ul></li></ul></li></ul></body></html>网页设计导航栏问题本回答由网友推荐<styletype="text/css"><!--ul,li{margin:0;padding:0;}#nav{height:400px;width:200px;border:1pxsolid#000000;}#navli{list-style-image:none;list-style-type:none;background-color:#99FF00;}#navli:hover{background-color:#333333;cursor:pointer;}--></style>这样也能实现你要的效果,不过ie6好像不支持。如果用<a>的话会比较复杂本回答由提问者推荐一种是在PS中自己用渐变色一个一个画 在切片切好点还有个方法就是flash做法同上你只用记住dreamweare只是个拼图软件所有特殊的炫彩效果都和他没关对于刚入门的设计网站前端的新手朋友们来说,难免会遇到导航栏错乱的现象,一般情况下导航栏居中对齐是首页显示最佳方式。那么如何用简单的div+css做出导航栏居中对齐的效果呢?本篇文章就为大家详细介绍一种非常简单的实现导航栏居中对齐的方法,希望对大家有所帮助!导航栏居中对齐示例代码如下:<DOCTYPEhtml><htmllang=en><head><metacharset=UTF-8><title>div+css做导航栏居中对齐示例</title></head><style>body{text-align:center;/*文字居中*/}ul{list-style-type:none;/*ul前面的点*/}*{margin:0px0px;/*到边框的距离*/}.menu{background:#029789;/*导航条背景的颜色*/}.nav{margin:0auto;/*导航栏文字的位置*/width:800px;/*和文字宽度有关,不能小于文字宽度的总和*/height:80px;/*导航栏的宽度*/}.nava{float:left;/*导航栏的位置配置*/width:140px;/*选中的文字块的长度*/line-height:80px;/*选中的文字块的宽度*/text-decoration:none;/*去掉连接下划线*/font-size:45px;/*字体大小*/color:#FFFFFF;/*字体颜色*/}.navlia:hover{background-color:#1094f2;/*选中的文字块的颜色*/text-decoration:none;/*选中时去掉连接下划线*/}.navlia:link{text-decoration:none;/*连接被点之后没有下划线*/}</style><body><divclass=menu><--class选择器--><divclass=nav><ul><--ul标签--><li><ahref=#>导航1</a></li><--li标签--><li><ahref=#>导航2</a></li><li><ahref=#>导航3</a></li><li><ahref=#>导航4</a></li><li><ahref=#>导航5</a></li></ul></div></div></body></html>此段代码可直接复制在本地测试,网页上显示如下图:相关标签属性介绍:text-decoration属性规定添加到文本的修饰。所属可能值和描述如下图想多高就多高...ullia就可以了自己下载一个看看office五个激活工具区域下载key前台有五个key可以永久激活每周复活一次其他多数key都是买的百度软偷界windows7九个激活工具信不信由你软偷界网站建设区域下载最近很多人要的优盘启动工具有大白菜绿叶电脑掉老毛桃百度软偷界系统安装区域下载
|