如何确定ul中几个ui按钮的统一高位?

时间:2014-11-24 08:43:35

标签: javascript jquery html jquery-mobile

如何确定ul中几个ui-btn的统一高度?

例如,在以下代码中:

<div data-role="navbar" class="ui-navbar" role="navigation">
            <ul class="ui-grid-d ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" role="tablist">
                <li class="ui-block-a ui-state-default ui-corner-top ui-tabs-active ui-state-active" role="tab" tabindex="0" aria-controls="one" aria-labelledby="ui-id-1" aria-selected="true"><a href="#one" data-ajax="false" class="ui-link ui-btn ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-1">Overview</a></li>
                <li class="ui-block-b ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="two" aria-labelledby="ui-id-2" aria-selected="false"><a href="#two" data-ajax="false" class="ui-link ui-btn ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-2">Products</a></li>
                <li class="ui-block-c ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="recent" aria-labelledby="ui-id-3" aria-selected="false"><a href="#recent" data-ajax="false" class="ui-link ui-btn ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-3">Employees</a></li>
                <li class="ui-block-d ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="recent" aria-labelledby="ui-id-4" aria-selected="false"><a href="#recent" data-ajax="false" class="ui-link ui-btn ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-4">Followers</a></li>
                <li class="ui-block-e ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="activity" aria-labelledby="ui-id-5" aria-selected="false"><a href="#activity" data-ajax="false" class="ui-link ui-btn ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-5">Recent activities</a></li>
            </ul>
        </div>

我不想确定每个<li> / <a>,只需为所有按钮确定一次

1 个答案:

答案 0 :(得分:0)

为您的导航栏添加如下ID:

<div data-role="navbar" class="ui-navbar" id="navbar1" role="navigation">

然后只使用此css代码:

#navbar .ui-btn{height:100px};

这只会改变此导航栏的高度而不影响其他导航栏。