zoukankan      html  css  js  c++  java
  • 漂亮的水平导航菜单css+ul li

    图片效果

    用到的背景图片

    代码如下,一定要引用jQuery132.js库哦,别的也可以

    <!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 runat="server">
        <title></title>

        <script src="../jquery132min.js" type="text/javascript"></script>

        <script type="text/javascript">
            $(function() {
                $("ul>li").click(function() {
                    $("ul>li").each(function() { $(this).removeClass("_lishow"); });
                    $(this).addClass("_lishow");
                });
            });
        </script>

        <style type="text/css">
            ul
            {
                list-style-type: none;
                border: 0px blue solid;
                height: 27px;
                480px;
            }
            ul li
            {
                list-style-type: none;
                float: left;
                74px;
                height: 27px;
                line-height: 27px;
                text-align: center;
                background-color: #CCCCFF;
                background: url(../images/tab.gif);
                background-position: -74px 0px;
            }
            ul li:hover
            {
                cursor: pointer;
            }
            ._lishow
            {
                background: url(../images/tab.gif);
                background-position: 0px 0px;
            }
        </style>
    </head>
    <body>
        <div>
            <ul>
                <li class="_lishow">Menu1</li>
                <li>Menu2</li>
                <li>Menu3</li>
                <li>Menu4</li>
                <li>Menu5</li>
                <li>Menu6</li>
            </ul>
            <br />
        </div>

    </body>
    </html>

  • 相关阅读:
    C#构造方法重载
    coffeeScript 语法总结
    JavaScript常用代码段
    CSS选择器,CSS3选择器
    CSS实用的代码段
    Gdb 调试
    Keras同时有多个输出时损失函数计算方法和反向传播过程
    PyTorch 速查
    Keras自定义Layer使用说明
    TensorFlow Variable 和 Tensor 的区别
  • 原文地址:https://www.cnblogs.com/ajun/p/2216768.html
Copyright © 2011-2022 走看看