为什么我的bootstrap导航栏元素在sm和xs大小上缩小

时间:2017-09-12 02:28:01

标签: html css twitter-bootstrap resize navbar

所以我一直试图在过去的3个小时内解决这个问题,但我无法弄清楚为什么我的元素在小尺寸上会缩小。

我尝试了很多东西。

目标:避免导航栏崩溃,因此我试图自定义它。我只想要很少的东西在小尺寸上消失。并没有其他影响。 元素的转移只是丑陋的事情,我需要帮助来阻止这种行为

编辑:我发现的一件事是navbar-header存在问题。

这是我的小提琴链接:https://jsfiddle.net/Lhw3rdvg/1/ ...

HTML

.navbar-inverse.nav-top {
    height: 37px;
}
.navbar-inverse.nav-top ul {
    float:right !important;
    display:table;
}

.navbar-inverse.nav-top .navbar-top >li{
    display:table-cell;
    font-size: 14px;
}

.navbar-inverse.nav-top .navbar-top >li >a{
    display:table-cell;
    font-size: 14px;
    padding:5px 10px;
    line-height: 12px;
}
/**********************************/
.navbar-collapse.collapse {
    display: block!important;
}

.navbar-nav>li, .navbar-nav {
    float: left !important;
}


.navbar-nav.navbar-right:last-child {
    margin-right: -15px !important;
}

.navbar-right {
    float: right!important;
}
.navbar-header{
    margin-right: 0 !important;
    margin-left: 0 !important;
}
.navbar-nav {
    margin:0 !important;
}


.navbar-header img{
    border: 8px solid #0d161a;
    border-radius: 8px;
    position: absolute;
    top: 15px;
    left: 45px;
    z-index: 1000;
    height: 96px;
    width:96px;
}
.navbar-header .social-header{
    width: 30px;
}

.ht60{
    height:60px;
}
.lft30{
    margin-left:30px;
}
.jc{
    height: 32px;
    width:auto;
}
.navbar-main
{
    position: absolute;
    width: 100%;
    left: 0;
    text-align: center;
    margin:0 auto;
    padding-top: 10px;
}
<nav class="navbar-inverse nav-top">
    <div class="container-fluid">
        <ul class="nav navbar-nav navbar-top">
            <li class="active"><a href="#">English <span class="sr-only">(current)</span></a></li>
            <li class="active"><a href="#"><i class="fa  fa-chevron-circle-down"></i></a></li>
        </ul>

    </div>

</nav>

<nav class="navbar-inverse navbar-default">
    <div class="container-fluid ht60 ">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <div class="social-header visible-lg-block visible-md-block visible-sm-block">
                <a class="facebook" href="#"><i class="fa fa-2x fa-facebook-square "></i></a>

                <a class="youtube" href="#"><i class="fa fa-2x fa-youtube-square"></i></a>

            </div>
            <a class="navbar-brand" href="#"><img src="../images/jj.png" /></a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->

    
        <ul class="nav navbar-nav droping">

                <li class="dropdown lft30">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">my first page<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
            </ul>
         <!--   <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>-->
            <ul class="nav navbar-nav navbar-right">
                <li class="active"><a href="#">Contact US</a></li>

            </ul>
        <!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

0 个答案:

没有答案