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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body
{
font-family
:Verdana;
font-size
:12px;
line-height
:1.5;
}

a
{
color
:#000;
text-decoration
:none;
}

a:hover
{
color
:#F00;
}
#menu
{
width
:100px;border:1px solid #ccc;
}
#menu ul
{
list-style
:none;
margin
:0px;
padding
:0px;
}
#menu ul li
{
background
:#eee;
padding
:0px 8px;
height
:26px;
line-height
:26px;
border-bottom
:1px solid #CCC;
position
:relative;
}
#menu ul li ul
{
display
:none;
position
:absolute;
left
:100px;
top
:0px;
width
:100px;
;border
:1px solid #ccc;
border-bottom
:none;
}
#menu ul li:hover ul
{
display
:block;
}
style>
head>
<body>
<div id="menu">
<ul>
<li><a href="@#">首页a>li>
<li><a href="#">网页版式布局a>
<ul>
<li><a href="#">自适应宽度a>li>
<li><a href="#">固定宽度a>li>
ul>
li>
<li><a href="#">div+css教程a>
<ul>
<li><a href="#">新手入门a>li>
<li><a href="#">视频教程a>li>
<li><a href="#">常见问题a>li>
ul>
li>
<li><a href="#">div+css实例a>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>
ul>
div>
body>
html>

  

转载于:https://www.cnblogs.com/dreamhome/archive/2011/07/24/2115603.html

你可能感兴趣的:(CSS弹出二级菜单)