1 回答
TA贡献1824条经验 获得超8个赞
.nav-item
上面的包装器结构.nav-link
仅适用于导航托管在<ul>
. 如果导航是使用自定义结构创建的,则选项卡/导航/药丸需要是.nav
父级的直接子级。
在您的场景中,您要么必须使用重新实现它,要么需要删除您及其内部元素<ul>
之间的 div 。.nav
.nav-link
你还有一个错字——nav-lin
应该是nav-link
。实际上,这不会影响您的布局,因为您已经.btn
向相同的元素添加了类。
这是您的代码,其中包含固定的拼写错误并删除了导航元素内的包装器 div:
<div class="container-fluid">
<div class="row">
<div class="col-md-12 mb-4">
<div class="">
<div class="nav nav-pills row">
<a class="nav-link active btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu1">Menu 1</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu2">Menu 2</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu3">Menu 3</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu4">Menu4 4</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu5">Menu 5</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu6">Menu 6</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu7">Menu 7</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu8">Menu 8</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu9">Menu 9</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu10">Menu 10</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu11">Menu 11</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu12">Menu 12</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-1">
<div class="nav nav-pills">
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu13">Menu 13</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu14">Menu 14</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu15">Menu 15</a>
</div>
</div>
<div class="col-md-10">
<div class="card">
<div class="card-body">
<div class="tab-content">
<div class="tab-pane container active" id="menu1">1</div>
<div class="tab-pane container fade" id="menu2">2</div>
<div class="tab-pane container fade" id="menu3">3</div>
<div class="tab-pane container fade" id="menu4">4</div>
<div class="tab-pane container fade" id="menu5">5</div>
<div class="tab-pane container fade" id="menu6">6</div>
<div class="tab-pane container fade" id="menu7">7</div>
<div class="tab-pane container fade" id="menu8">8</div>
<div class="tab-pane container fade" id="menu9">9</div>
<div class="tab-pane container fade" id="menu10">10</div>
<div class="tab-pane container fade" id="menu11">11</div>
<div class="tab-pane container fade" id="menu12">12</div>
<div class="tab-pane container fade" id="menu13">13</div>
<div class="tab-pane container fade" id="menu14">14</div>
<div class="tab-pane container fade" id="menu15">15</div>
<div class="tab-pane container fade" id="menu16">16</div>
<div class="tab-pane container fade" id="menu17">17</div>
<div class="tab-pane container fade" id="menu18">18</div>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="nav nav-pills">
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu16">Menu 16</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu17">Menu 17</a>
<a class="nav-link btn btn-outline-secondary btn-lg" data-toggle="pill" href="#menu18">Menu18</a>
</div>
</div>
</div>
</div>
- 1 回答
- 0 关注
- 120 浏览
添加回答
举报