纯css实现多级菜单折叠效果

代码语言:html

所属分类:菜单导航

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!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>CSS实现鼠标点击展开折叠的菜单</title>
    <style type="text/css">
    body{
        padding: 100px;
    }
    
        #menu {
            margin: 0px;
            padding: 0px;
        }
        #menu a{
            color: black;
        }
        #menu h1 {
            margin: 0px;
   
            font-size: 14px;
        }
        #menu li {
            list-style: none;
            display: block;
            width: 178px;
            border: 1px solid black;
            border-bottom-width: 0px;
        }
        #menu li.end {
            border-bottom-width: 1px;
        }
        #menu li a {
            display: block;
            text-decoration: none;
            width: 158px;
            padding: 10px;
            
        }
        #menu li a span {
            display: none;
            color: #333;
            font-size: 12px;
            padding: 10px 0 0 0;
        }
        #menu li a:hover{
            background: #f1f1f1;
           
        }
        #menu li a:focus span {
            display: block;
            cu.........完整代码请登录后点击上方下载按钮下载查看

网友评论0