首页 > 代码库 > [CSS]简易菜单

[CSS]简易菜单

样式代码:

    <style type="text/css">        #menu ul {            list-style: none;            width: 100px;            text-align: center;        }            #menu ul li {                /*float: left;*/                padding: 10px;                margin: 2px;                background-color: aquamarine;                color: yellow;            }                #menu ul li a {                    text-decoration: none;                }    </style>

image

脚本代码:

        <div id="menu">            <ul>                <li><a href="#">地图</a></li>                <li><a href="#">全景</a></li>                <li><a href="#">拆分</a></li>            </ul>        </div>

代码效果:

image

如果需要制作横向的菜单,只需稍微修改样式代码即可:

image

代码效果:

image

希望有所帮助!

<style type="text/css">.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }</style>

<style type="text/css">.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }</style>