S
S
Sergey Beloventsev2016-09-21 11:08:23
css
Sergey Beloventsev, 2016-09-21 11:08:23

How to make a menu in bootstrap-3?

Is it possible to make the bootstrap-3 menu fit the width of the screen and not the parent component?
there is a need to organize the menu in this way d194131678cd4b9890070e7173ba3523.jpe
tried to implement in this way

<nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
          <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav col-lg-10 col-md-10 col-sm-20 col-xs-20">
              <li><a href="#">Главная/a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Для него </a>
                <ul class="dropdown-menu">
                  <ul class="nav nav-pills nav-stacked nav-tabs">
                    <li class="active"><a href="#home_him" data-toggle="tab">Главная</a></li>
                    <li><a href="#profile_him" data-toggle="tab">Профиль</a></li>
                    <li><a href="#messages_him" data-toggle="tab">Сообщения</a></li>
                    <li><a href="#settings_him" data-toggle="tab">Настройки</a></li>
                  </ul>
                  <div class="tab-content">
                    <div class="tab-pane active" id="home_him">
                      <li><a href="#">Действие</a></li>
                      <li><a href="#">Другое действие</a></li>
                      <li><a href="#">Что-то еще</a></li>
                    </div>
                    <div class="tab-pane" id="profile_him">
                      <li><a href="#">Действие</a></li>
                      <li><a href="#">Другое действие</a></li>
                      <li><a href="#">Что-то еще</a></li>
                    </div>
                    <div class="tab-pane" id="messages_him">
                      <li><a href="#">Действие</a></li>
                      <li><a href="#">Другое действие</a></li>
                      <li><a href="#">Что-то еще</a></li>
                    </div>
                    <div class="tab-pane" id="settings_him">
                      <li><a href="#">Действие</a></li>
                      <li><a href="#">Другое действие</a></li>
                      <li><a href="#">Что-то еще</a></li>
                    </div>
                  </div>
                </ul>
              </li> 
                                                       ...
                                               </ul>
                                       </div>
                                 </div>

nothing came out of this, even the drop-down menu does not work. Is it possible to make such a menu in bootstrap 3 using standard methods?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Smirnov, 2016-09-21
@W3s

width: 100vw;
Seems like it should work

M
Maxim Timofeev, 2016-09-21
@webinar

To move an element outside the parent, you need to make it absolute positioning or fixed, which can also work for a menu.
Another question is why? Maybe you should just move it outside the parent or make the parent full screen? With width: 100vw; or width: 100%;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question