D
D
Dmitry Klimantovich2018-12-11 17:05:56
Bootstrap
Dmitry Klimantovich, 2018-12-11 17:05:56

How to make tab switching based on Bootstrap-4 but not using list-group?

Good afternoon.
Bootstrap has the ability to use a list group with tab switching:

<div class="row">
  <div class="col-4">
    <div class="list-group" id="list-tab" role="tablist">
      <a class="list-group-item list-group-item-action active" id="list-home-list" data-toggle="list" href="#list-home" role="tab" aria-controls="home">Home</a>
      <a class="list-group-item list-group-item-action" id="list-profile-list" data-toggle="list" href="#list-profile" role="tab" aria-controls="profile">Profile</a>
      <a class="list-group-item list-group-item-action" id="list-messages-list" data-toggle="list" href="#list-messages" role="tab" aria-controls="messages">Messages</a>
      <a class="list-group-item list-group-item-action" id="list-settings-list" data-toggle="list" href="#list-settings" role="tab" aria-controls="settings">Settings</a>
    </div>
  </div>
  <div class="col-8">
    <div class="tab-content" id="nav-tabContent">
      <div class="tab-pane fade show active" id="list-home" role="tabpanel" aria-labelledby="list-home-list">...</div>
      <div class="tab-pane fade" id="list-profile" role="tabpanel" aria-labelledby="list-profile-list">...</div>
      <div class="tab-pane fade" id="list-messages" role="tabpanel" aria-labelledby="list-messages-list">...</div>
      <div class="tab-pane fade" id="list-settings" role="tabpanel" aria-labelledby="list-settings-list">...</div>
    </div>
  </div>
</div>

But it's tied to a list-group that goes vertical and adds a lot of properties that I don't need. And how do I do this to my switches? Or maybe there is an option in bootstap to switch horizontal tabs - I didn’t find something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NaN, 2018-12-12
@KornevaViktoria

write your own modifier classes and play with the styles. in the same place with the help of flex done, change the flex-direction. well, the rest.
But in general, if you can do something yourself - do it. it's not a very complicated component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question