如何在屏幕达到660px时隐藏SideBar Bootstrap

时间:2017-12-05 22:20:57

标签: javascript jquery html css sidebar

当我放大时,我正试图隐藏Bootstrap的SideBar。“@ media only screen and(max-width:660px)”但结果是它自动部署,我不希望这种情况发生。

Este eselcódigodebootstrap:

@media only screen and (max-width:660px) {
#header {
    height: 160px
}

    #header .brand {
        width: 100%
    }

    #header .user-nav ul {
        padding-left: 0
    }

    #header .toggle-navigation.toggle-left {
        float: left
    }

.sidebar {
    margin-left: -240px
}

.sidebar-toggle {
    margin-left: 0;
    width: 100%
}



.main-content-wrapper {
    margin-left: 0
}

.main-content-toggle-left {
    margin-left: 0px;
}

.sidebarRight {
    top: 160px;
    width: 100%
}

.user-nav ul li {
    font-size: 12px
}


}

this is my html code

1 个答案:

答案 0 :(得分:1)

使用新的类并插入     可见性:隐藏;

@media(max-width: 660px){
  .hide{
    visibility: hidden;
  }
}


<nav class="sidebar sidebar sidebar-toggle hide">