🔥点击切换到对应容器(上下)
<!----------------------首页可灵活切换大型板块开始了-----------------------> <nav> <div class="nav nav-tabs" id="nav-tab" role="tablist"> <a class="nav-link active" data-toggle="tab" href="#nav-111" role="tab" aria-selected="false"><i class="fas fa-tshirt"></i> AAA</a> <a class="nav-link" data-toggle="tab" href="#nav-222" role="tab" aria-selected="true"><i class="fas fa-user-astronaut"></i> BBB</a> <a class="nav-link" data-toggle="tab" href="#nav-333" role="tab" aria-selected="false"><i class="fas fa-cat-space"></i> CCC</a> <a class="nav-link" data-toggle="tab" href="#nav-444" role="tab" aria-selected="false"><i class="fas fa-skull"></i> DDD</a> </div> </nav> <div class="tab-content" id="nav-tabContent"> <div class="tab-pane fade show active" id="nav-111" role="tabpanel" aria-labelledby="nav-home-tab"> <br> <div class="media"> <div class="media-body"> <!------------- 1 / 4 ----------------> <span style="font-size:50px; font-weight: bold;">AAA</span > <!------------- 1 / 4 ----------------> </div> </div> </div> <div class="tab-pane fade" id="nav-222" role="tabpanel" aria-labelledby="nav-profile-tab"> <br> <div class="media"> <div class="media-body"> <!------------- 2 / 4 ----------------> <span style="font-size:50px; font-weight: bold;">BBB</span > <!------------- 2 / 4 ----------------> </div> </div> </div> <div class="tab-pane fade" id="nav-333" role="tabpanel" aria-labelledby="nav-profile-tab"> <br> <div class="media"> <div class="media-body"> <!------------- 3 / 4 ----------------> <span style="font-size:50px; font-weight: bold;">CCC</span > <!------------- 3 / 4 ----------------> </div> </div> </div> <div class="tab-pane fade" id="nav-444" role="tabpanel" aria-labelledby="nav-profile-tab"> <br> <div class="media"> <div class="media-body"> <!------------- 4 / 4 ----------------> <span style="font-size:50px; font-weight: bold;">DDD</span > <!------------- 4 / 4 ----------------> </div> </div> </div> </div> <!----------------------首页可灵活切换大型板块结束了----------------------->
CSS代码:
<!-------------被选中标签颜色切换----------------> <style> .nav-link { color: #9B9B9B !important; } .nav-link.active { color: #000000 !important; } </style> <!-------------被选中标签颜色切换---------------->