简体   繁体   中英

Margin of collapsed navbar-text in Bootstrap 3.3.5

I have this navbar code:

<div class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <span class="navbar-brand"><img width=20 height=20 src="{% static 'images/mmlogo.png' %}"></span>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
              <ul class="nav navbar-nav navbar-right">
                <li><p class="navbar-text">Ты не вошел</p></li>
              </ul>
            </div>
          </div>
    </div>

But when my browser's screen's width is small (like mobile phone) and Bootstrap collapses some elements, I get this:

错误

There's no margin/padding. But when I change <li><p class="navbar-text">Ты не вошел</p></li> to <li><a href="#">Ты не вошел</a></p></li> , everything is OK:

对

But I don't need a link, I just need unclickable text. What am I doing wrong?

试试这个

<li><div class="col-lg-12"><p class="navbar-text">Ты не вошел</p></div></li>

If you have CSS you should post it. If you don't have any CSS related to the text then it is just using default styling from bootstrap.css

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM