问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

HTML 二级导航菜单

发布网友 发布时间:2022-04-21 21:00

我来回答

2个回答

热心网友 时间:2022-04-19 07:14

代码如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        #menu
        {
            width: 600px;
            font-family: Arial;
            font-size: 15px;
        }
        #menu ul
        {
            display: block;
            width: 100%;
            margin: 0;
            position: relative;
        }
        #menu ul li
        {
            list-style-type: none;
            float: left;
            height: 25px;
            width: 120px;
            line-height: 25px;
            text-align: center;
            background: #000;
            color: #fff;
        }
        #menu ul li ul
        {
            display: list-item;
            margin: 0;
            position: relative;
            right: 40px;
            font-size: 12px;
            display: none;
        }
        #menu ul li a
        {
            text-decoration: none;
            color: #ffffff;
        }
        #menu ul li:hover
        {
            background: #686868;
            color: #000;
            cursor: pointer;
        }
        #menu ul li:hover ul
        {
            display: list-item;
        }
        #menu ul li:hover ul li:hover
        {
            background: 868686;
            color: #ff5588;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div id="menu">
        <ul>
            <li><a href="http://www.shangkeit.com" target="_blank">一级导航1</a>
                <ul>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航1</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航2</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航3</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航4</a>
                    </li>
                </ul>
            </li>
            <li><a href="http://www.shangkeit.com" target="_blank">一级导航2</a>
               <ul>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航1</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航2</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航3</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航4</a>
                    </li>
                </ul>
            </li>
            <li><a href="http://www.shangkeit.com" target="_blank">一级导航3</a>
               <ul>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航1</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航2</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航3</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航4</a>
                    </li>
                </ul>
            </li>
            <li><a href="http://www.shangkeit.com" target="_blank">一级导航4</a>
               <ul>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航1</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航2</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航3</a></li>
                    <li><a href="http://www.shangkeit.com" target="_blank">二级导航4</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</body>
</html>

复制上面代码,保存到后缀为.html或者.htm的文件中,用浏览器打开就可以看到效果。效果图如下:

热心网友 时间:2022-04-19 08:32

<!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>二级dropdown弹出菜单--A CROSS BROWSER DROP DOWN CASCADING VALIDATING MENU</title>
<style type="text/css">
/* common styling */
/* set up the overall width of the menu div, the font and the margins */
.menu {
font-family: arial, sans-serif;
width:750px;
margin:0;
margin:50px 0;
}
/* remove the bullets and set the margin and padding to zero for the unordered list */
.menu ul {
padding:0;
margin:0;
list-style-type: none;
}
/* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */
.menu ul li {
float:left;
position:relative;
}
/* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */
.menu ul li a, .menu ul li a:visited {
display:block;
text-align:center;
text-decoration:none;
width:104px;
height:30px;
color:#000;
border:1px solid #fff;
border-width:1px 1px 0 0;
background:#c9c9a7;
line-height:30px;
font-size:11px;
}
/* make the dropdown ul invisible */
.menu ul li ul {
display: none;
}
/* specific to non IE browsers */
/* set the background and foreground color of the main menu li on hover */
.menu ul li:hover a {
color:#fff;
background:#b3ab79;
}
/* make the sub menu ul visible and position it beneath the main menu list item */
.menu ul li:hover ul {
display:block;
position:absolute;
top:31px;
left:0;
width:105px;
}
/* style the background and foreground color of the submenu links */
.menu ul li:hover ul li a {
display:block;
background:#faeec7;
color:#000;
}
/* style the background and forground colors of the links on hover */
.menu ul li:hover ul li a:hover {
background:#dfc184;
color:#000;
}
</style>
<!--[if lte IE 6]>
<style type="text/css">
/* styling specific to Internet Explorer IE5.5 and IE6. Yet to see if IE7 handles li:hover */
/* Get rid of any default table style */
table {
border-collapse:collapse;
margin:0;
padding:0;
}
/* ignore the link used by 'other browsers' */
.menu ul li a.hide, .menu ul li a:visited.hide {
display:none;
}
/* set the background and foreground color of the main menu link on hover */
.menu ul li a:hover {
color:#fff;
background:#b3ab79;
}
/* make the sub menu ul visible and position it beneath the main menu list item */
.menu ul li a:hover ul {
display:block;
position:absolute;
top:32px;
left:0;
width:105px;
}
/* style the background and foreground color of the submenu links */
.menu ul li a:hover ul li a {
background:#faeec7;
color:#000;
}
/* style the background and forground colors of the links on hover */
.menu ul li a:hover ul li a:hover {
background:#dfc184;
color:#000;
}
</style>
<![endif]-->
</head>
<body>
<div class="menu">
<ul>
<li><a class="hide" href="../menu/index.html">DEMOS</a>
<!--[if lte IE 6]>
<a href="../menu/index.html">DEMOS
<table><tr><td>
<![endif]-->
<ul>
<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars</a></li>
<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text</a></li>
<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>
<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>
<li><a href="../menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing</a></li>
<li><a href="../menu/old_master.html" title="Image Map for detailed information">image map</a></li>
<li><a href="../menu/bodies.html" title="fun with background images">fun backgrounds</a></li>
<li><a href="../menu/fade_scroll.html" title="fade-out scrolling">fade scrolling</a></li>
<li><a href="../menu/em_images.html" title="em size images compared">em sized images</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="index.html">MENUS</a>
<!--[if lte IE 6]>
<a href="index.html">MENUS
<table><tr><td>
<![endif]-->
<ul>
<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>
<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>
<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>
<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>
<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>
<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>
<li><a href="circles.html" title="circular links">circular links</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="../layouts/index.html">LAYOUTS</a>
<!--[if lte IE 6]>
<a href="../layouts/index.html">LAYOUTS
<table><tr><td>
<![endif]-->
<ul>
<li><a href="../layouts/bodyfix.html" title="Cross browser fixed layout">Fixed 1</a></li>
<li><a href="../layouts/body2.html" title="Cross browser fixed layout">Fixed 2</a></li>
<li><a href="../layouts/body4.html" title="Cross browser fixed layout">Fixed 3</a></li>
<li><a href="../layouts/body5.html" title="Cross browser fixed layout">Fixed 4</a></li>
<li><a href="../layouts/minimum.html" title="A simple minimum width layout">minimum width</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="../boxes/index.html">BOXES</a>
<!--[if lte IE 6]>
<a href="../boxes/index.html">BOXES
<table><tr><td>
<![endif]-->
<ul>
<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>
<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>
<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>
<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>
<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>
<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>
<li><a href="circles.html" title="circular links">circular links</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="../mozilla/index.html">MOZILLA</a>
<!--[if lte IE 6]>
<a href="../mozilla/index.html">MOZILLA
<table><tr><td>
<![endif]-->
<ul>
<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>
<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>
<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>
<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>
<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">rainbow box</a></li>
<li><a href="../mozilla/snooker.html" title="Snooker cue">snooker cue</a></li>
<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>
<li><a href="../mozilla/splittext.html" title="Two tone headings">two tone headings</a></li>
<li><a href="../mozilla/shadow_text.html" title="Shadow text">shadow text</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="../ie/index.html">EXPLORER</a>
<!--[if lte IE 6]>
<a href="../ie/index.html">EXPLORER
<table><tr><td>
<![endif]-->
<ul>
<li><a href="../ie/exampleone.html" title="Example one">example one</a></li>
<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>
<li><a href="../ie/exampletwo.html" title="Vertical align">vertical align</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="../opacity/index.html">OPACITY</a>
<!--[if lte IE 6]>
<a href="../opacity/index.html">OPACITY
<table><tr><td>
<![endif]-->
<ul>
<li><a href="../opacity/colours.html" title="colour wheel">opaque colours</a></li>
<li><a href="../opacity/picturemenu.html" title="a menu using opacity">opaque menu</a></li>
<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>
<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
</ul>
<!-- clear the floats if required -->
<div class="clear"> </div>
</div>
</body>
</html>
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
K790支持什么样的格式 并且需要注意存储的时候需要注意什么 索爱K790怎么区分行水货 怎么看知道是不是翻新的 索爱z550的上网的设置~~请高手教设置! 索尼爱立信 【无网络访问权限】 K790手机上网 CMWAP 请告诉我索爱K790怎么设置上网参数? 怎样才能清除QQ游戏里面玩的记录 襄阳公积金贷款得多久 襄阳公积金贷款多久 襄阳公积金贷款多久 襄阳公积金贷款办理时间限制是多久? 华为手机怎么查找删除后又恢复的照片? 请问菜单和导航有什么区别? 导航菜单不能全部显示,怎么修改啊?(已解决) 别克英朗怎么退出导航回到主菜单 网页制作 导航菜单形式什么意思 哈弗F5-视听系统导航导航菜单是什么? 制作网页中有哪些导航菜单? 导航下拉菜单(二级分类)怎么弄 导航菜单是什么意思? 疫情作文结尾优美句子 怎样在页面中插入导航菜单 愿疫情早日结束,春暖花开的句子有什么? “及”在古代汉语里是象形字吗? 疫情结束重返校园记叙文怎么写? 及的部首是什么? 我的愿望是希望疫情早点结束的作文? “始料不及”中“及”是什么意思?A达到 B赶得上 C比得上 抗疫情作文结尾怎么写 迫不及待 “及”是什么意思 疫情文案短句干净治愈 奥迪Q5导航怎么调菜单面? 用dreamweaver做二级导航菜单,用什么方法好,怎么... 苹果手机的开机导航菜单怎么取消? 金山word怎么把pdf转换成word 金山的什么软件可以将pdf转word 金山WPS的PDF(图文)转Word的效果怎么样 金山PDF转换word只能在网页上转换了吗? 怎样把pdf文件转化word,我用的是金山0ffice2012,求... 金山什么软件可以把pdf转word 苹果6能自己设置动态壁纸吗?不是自带的那种, Foxmail邮箱有没有手机版的 手机怎么样可以收发foxmail 的邮件 foxmail有手机客户端吗 如何用手机登陆foxmail邮箱? foxmail6.5版本,如何在手机上登录? foxmail有iphone版本吗 如何用手机登陆我的foxmail邮箱 foxmail邮箱如何在手机上设置? Foxmail的企业邮箱如何在手机上登陆 为什么foxmail没有安卓版本