html - 导航栏和侧边栏同时使用 Bootstrap ?

标签 html css twitter-bootstrap twitter-bootstrap-3

这看起来有点傻,但我想实现这个侧边栏:http://jasny.github.io/bootstrap/examples/navmenu-push/http://getbootstrap.com/components/#nav (导航栏 navbar-default 示例)。

将两者结合起来的最佳方式是什么?还是我应该查看另一个侧边栏包?如果有任何不同,我会使用 Angular。

因为我不能发布图片...请查看我的评论以了解它当前的样子。

最佳答案

您可以使用 Bootstrap 和 CSS 做类似的事情。不需要另一个包。只需设置您希望边栏在激活时推送主要内容的百分比(即:40%):

@media screen and (max-width: 768px) {
  .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-left
  .sidebar-offcanvas {
    left: -40%;
  }

  .row-offcanvas-left.active {
    left: 40%;
  }

  .sidebar-offcanvas {
    position: absolute;
    top: 0;
    width: 40%;
    margin-left: 12px;
  }
}

http://codeply.com/go/ppK9PJ4i5f

关于html - 导航栏和侧边栏同时使用 Bootstrap ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29271080/

相关文章:

html - CSS 对齐聊天界面的 3 个布局元素

javascript - 如何从文本形式获取html脚本并在新窗口中执行?

javascript - 删除 div 内的一行

javascript - 我如何摆脱这种不需要的裁剪?

html - 当使用 bootstrap 4 和 AngularMaterial2 减小屏幕尺寸时,文本不对齐

html - Bootstrap 面板不会在平板电脑 View 中水平对齐

javascript - 使用递归函数 Vanilla Javascript 节流显示 div 和子项

javascript - 销毁 ID 包含特定字符串的 DIV

css - 无法使用 Node-sass、bootstrap-sass 加载 Bootstrap

html - 如何去除bootstrap 4按钮点击效果