简体   繁体   English

在uib-tab标头中居中放置文本,同时仍然使整个标签可点击?

[英]Centering text inside uib-tab header while still making the entire tab clickable?

I'm having some CSS trouble. 我遇到CSS麻烦。 I have a group of bootstrap tabs that each are clickable and open a different part of my page. 我有一组引导程序选项卡,每个选项卡都可以单击并打开页面的不同部分。 Problem is, only the text in the tab is clickable and not the entire tab itself. 问题是,只有选项卡中的文本是可单击的,而不是整个选项卡本身。

I am able to solve this by setting the width to 100%, the height to inherit, and the display to block. 我可以通过将宽度设置为100%,将高度设置为继承,将显示设置为阻止来解决此问题。 The problem is, no no matter what I've tried so far, the text in the tab aligns with the top of the area instead of in the center. 问题是,无论到目前为止我进行了什么尝试,选项卡中的文本都与区域的顶部对齐,而不是与中心对齐。 Here is my HTML: 这是我的HTML:

    <section class="tournament-tabs container">
        <uib-tabset class="tab-nav">
            <uib-tab heading="{{labels.lblOverview}}">
                <div class="tab-overview">
                    <div ng-include="'modules/tournaments/partial/tournaments-view/overview-tab.html'">></div>
                </div>
            </uib-tab>
            <uib-tab heading="{{labels.lblRules}}">
                <div class="tab-rules">
                    <div ng-include="'modules/tournaments/partial/tournaments-view/rules-tab.html'"></div>
                </div>
            </uib-tab>
            <uib-tab heading="{{labels.lblPlayers}}" disable="isBracketdisabled">
                <div class="tab-players">
                    <div ng-include="'modules/tournaments/partial/tournaments-view/players-tab.html'">></div>
                </div>
            </uib-tab>
            <uib-tab heading="{{labels.lblBrackets}}" disable="isBracketdisabled">
                <bracket bracketdata="bracketData" options="bracketOpts" ></bracket>
                <div ng-if="loadingmatch" class="page-loading">
                    <i class='fa fa-circle-o-notch fa-5x fa-spin'></i>
                </div>
            </uib-tab>
        </uib-tabset>

    </section>

And here's the CSS I use for the tabs (using .LESS): 这是我用于选项卡的CSS(使用.LESS):

  .tab-nav .nav-tabs{
    margin: 30px 0;
    text-transform: uppercase;
    text-align: center;

    li a {
      font-size: 14px;
      width: 100%;
      display:block;
      height:100%;
    }
  }

Is there something simple I'm just not seeing because it's Friday at 11? 有什么简单的事情我没看到,因为它是星期五的11点?

If it's just vertical alignment you want, use flex 如果只是垂直对齐,请使用flex

 .tab-nav .nav-tabs{
   display: flex;
   align-items: center;
   justify-content: center;
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM