我有三个标签,我使用button
代替了ul
和li
标签。我希望第一个按钮自动激活或将颜色更改为绿色。我在引导程序中使用活动类,但是它根本不起作用。我该怎么做,以便用户知道他/她在哪里?这是我的jsfiddle:https://jsfiddle.net/heuvkro0/5/
<div class="nav nav-pills mt-4">
<button class="nav-link active btn btn-sm text-light bg-info font-weight-bold float-left" href="#profile" role="tab" data-toggle="tab">
<span class="number text-light">1</span>
<span class="title text-light font-weight-bold pr-2">Beneficiary Details </span>
</button>
<button class="nav-link btn btn-sm text-light bg-info font-weight-bold float-left ml-2" href="#buzz" role="tab" data-toggle="tab">
<span class="number text-light">2</span>
<span class="title text-light font-weight-bold pr-2">Dependent Details </span>
</button>
<button class="nav-link btn btn-sm text-light bg-info font-weight-bold float-left ml-2" href="#references" role="tab" data-toggle="tab">
<span class="number text-light">3</span>
<span class="title text-light font-weight-bold pr-2">Complete Details </span>
</button>
</div>
答案 0 :(得分:4)