自适应宽度的标签导航

2 篇文章 0 订阅
 
 <style type="text/css">
        BODY
        {
            font-family: "宋体";
        } 
        #tags
        {
            padding-right: 0px;
            padding-left: 0px;
            padding-bottom: 0px;
            margin: 0px 0px 0px 10px;
            width: 400px;
            padding-top: 0px;
            height: 23px;
        }
        #tags LI
        {
            background: url(../../images/tagleft.gif) no-repeat left bottom;
            float: left;
            margin-right: 1px;
            list-style-type: none;
            height: 23px;
        }
        #tags LI A
        {
            padding-right: 10px;
            padding-left: 10px;
            background: url(../../images/tagright.gif) no-repeat right bottom;
            float: left;
            padding-bottom: 0px;
            color: #999;
            line-height: 23px;
            padding-top: 0px;
            height: 23px;
            text-decoration: none;
        }
        #tags LI.emptyTag
        {
            background: none transparent scroll repeat 0% 0%;
            width: 4px;
        }
        #tags LI.selectTag
        {
            background-position: left top;
            margin-bottom: -2px;
            position: relative;
            height: 25px;
        }
        #tags LI.selectTag A
        {
            background-position: right top;
            color: #000;
            line-height: 25px;
            height: 25px;
        }
    </style>

    <script language="javascript"> 
        function selectTag(selfObj) {
            // 操作标签
            var tag = document.getElementById("tags").getElementsByTagName("li");
            var taglength = tag.length;
            for (i = 0; i < taglength; i++) {
                tag[i].className = "";
            }
            selfObj.parentNode.className = "selectTag";
        }
    </script>

 <div id="linkinfos" style="width: 100%; font-size: 10pt; font-weight: bold;" align="left">
        <ul id="tags">
            <li class="selectTag"><a οnclick="selectTag(this)" href="CaseMeg.aspx" target="maincenter">
                案件消息</a> </li>
            <li><a οnclick="selectTag(this)" href="ReceiveMeg.aspx" target="maincenter">我的消息</a>
            </li>
            <li><a οnclick="selectTag(this)" href="SentMeg.aspx" target="maincenter">已发送</a>
            </li>
            <li><a οnclick="selectTag(this)" href="SendMeg.aspx" target="maincenter">发送消息</a>
            </li>
        </ul> 
    </div>



source : http://www.lanrentuku.com/js/biaoqian-514.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值