twitter-bootstrap - 需要 Bootstrap 左侧导航示例

标签 twitter-bootstrap twitter-bootstrap-3

寻找一些干净简单的示例来设置响应式左侧导航,几乎就像 Foundation 用于他们的版本一样。 4 个文档页面,位于 http://foundation.zurb.com/docs/v/4.3.2/index.html需要能够链接到页面,并且如果在其下方分组有子页面,则还需要进行扩展。有什么好的 Bootstrap 示例可以做到这一点?

最佳答案

看看这个例子。这是一个带有可折叠子菜单的左侧非 Canvas 菜单..

Bootstrap 3: http://www.bootply.com/129625

/* collapsed sidebar styles */
@media screen and (max-width: 767px) {
  .row-offcanvas {
    position: relative;
    -webkit-transition: all 0.25s ease-out;
    -moz-transition: all 0.25s ease-out;
    transition: all 0.25s ease-out;
  }
  .row-offcanvas-right
  .sidebar-offcanvas {
    right: -41.6%;
  }

  .row-offcanvas-left
  .sidebar-offcanvas {
    left: -41.6%;
  }
  .row-offcanvas-right.active {
    right: 41.6%;
  }
  .row-offcanvas-left.active {
    left: 41.6%;
  }
  .sidebar-offcanvas {
    position: absolute;
    top: 0;
    width: 41.6%;
  }
  #sidebar {
    background-color:#3b3b3b;
    padding-top:0;
  }
  #sidebar .nav>li {
    color: #ddd;
    background: linear-gradient(#3E3E3E, #383838);
    border-top: 1px solid #484848;
    border-bottom: 1px solid #2E2E2E;
  }
  #sidebar .nav>li:first-child {
    border-top:0;
  }
  #sidebar .nav>li>a {
    color: #ddd;
  }
  #sidebar .nav>li>a>img {
    max-width: 14px;
  }
  #sidebar .nav>li>a:hover, #sidebar .nav>li>a:focus {
    text-decoration: none;
    background: linear-gradient(#373737, #323232);
    color: #fff;  
  }
  #sidebar .nav .caret {
    border-top-color: #fff;
    border-bottom-color: #fff;
  }
  #sidebar .nav a:hover .caret{
    border-top-color: #fff;
    border-bottom-color: #fff;
  }
}

Bootstrap 4: https://www.codeply.com/go/JbaVzJCNLJ/bootstrap-4-off-canvas-sidebar

关于twitter-bootstrap - 需要 Bootstrap 左侧导航示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22902875/

相关文章:

javascript - Bootstrap 表 td 值着色

css - 使用 Bootstrap 3 是否可以使列换行并具有相同的高度?

css - Bootstrap 3 为手机和平板电脑重新排序列

javascript - Bootstrap 下拉列表

html - 是否必须将所有内容(即使只是一栏)放在行内?

javascript - 检查 bootstrap 中的复选框是否被选中

css - 在不接触源代码的情况下定制 Bootstrap

html - Bootstrap 内联表单元素

javascript - Bootstrap : Using panel heading to collapse panel body

jquery - 从基本 HTML 和 CSS 转向 Bootstrap 或流体布局