V
V
Vladimir Golub2016-03-24 17:36:34
css
Vladimir Golub, 2016-03-24 17:36:34

How to change width for transition in Bootstrap button?

Through experiments, I found out that the transition to the button in Bootstrap always occurs with a width of 767-768 pixels, regardless of the width of the content in the menu. How to control it to reduce or increase?
Solution) I think many people want to do this. I will write step by step
1) We find lines in the file.

@media (min-width: 1250px) {
  .navbar-collapse {
    width: auto;
    border-top: 0;
    -webkit-box-shadow: none;
            box-shadow: none;
  }
  .navbar-collapse.collapse {
    display: block !important;
    height: auto !important;
    padding-bottom: 0;
    overflow: visible !important;
  }
  .navbar-collapse.in {
    overflow-y: visible;
  }
  .navbar-fixed-top .navbar-collapse,
  .navbar-static-top .navbar-collapse,
  .navbar-fixed-bottom .navbar-collapse {
    padding-right: 0;
    padding-left: 0;
  }
}

and specify the required width
2) Find the lines
@media (min-width: 1250px) {
  .navbar-toggle {
    display: none;
  }
}

and specify the required width
3) Find the lines
@media (min-width: 1250px) {
  .navbar-header {
    float: left;
  }
}

and specify the desired width
4) In your media.css file, we prescribe that at the desired width li become block. // Thanks to Sergey Goryachev
for help in answering

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Goryachev, 2016-03-24
@RazerVG

Damn, how do you even work with Bootstrap if you don't know the basics?
And in general, why the heck take on the Framework if there is zero knowledge of the adaptive.
Look in @media-requests, where it is written for you.
You can also search "through experiments" through the developer console in the browser.
A very useful thing to study.

@media (min-width: 768px) {
  .navbar-toggle {
    display: none;
  }
}
@media (min-width: 768px) {
  .navbar-collapse.collapse {
    display: block !important;
    height: auto !important;
    padding-bottom: 0;
    overflow: visible !important;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question