html - Bootstrap CSS: Fixed Left Side Bar -
i working on web page based on bootstrap css i'd similar bootstrap dashboard example. problem experiencing section @ right side of left fixed sidebar scrolls horizontally while i'd fixed (although fluid). here jsfiddle page reproducing issue
http://jsfiddle.net/k7m5f/embedded/result/
here html
<div class="container-fluid"> <div class="row-fluid"> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> <li><a href="#" class="active">choicea</a> </li> <li><a href="#">choiceb</a> </li> </ul> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" style="height: 100%; width: 100%;"> <div class="row">this test</div>
and here css
@import url("//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"); body { padding-top: 50px; } .sub-header { padding-bottom: 10px; border-bottom: 1px solid #eee; } .sidebar { display: none; } @media (min-width : 768px) { .sidebar { position: fixed; top: 51px; bottom: 0; left: 0; z-index: 1000; display: block; padding: 20px; overflow-x: hidden; overflow-y: auto; /* scrollable contents if viewport shorter content. */ background-color: #f5f5f5; border-right: 1px solid #eee; } } /* sidebar navigation */ .nav-sidebar { margin-right: -21px; /* 20px padding + 1px border */ margin-bottom: 20px; margin-left: -20px; } .nav-sidebar>li>a { padding-right: 20px; padding-left: 20px; } .nav-sidebar>.active>a { color: #fff; background-color: #428bca; } /* * main content */ .main { padding: 20px; } @media (min-width : 768px) { .main { padding-right: 40px; padding-left: 40px; } } .main .page-header { margin-top: 0; } /* * placeholder dashboard ideas */ .placeholders { margin-bottom: 30px; text-align: center; } .placeholders h4 { margin-bottom: 0; } .placeholder { margin-bottom: 20px; } .placeholder img { display: inline-block; border-radius: 50%; } .controls { margin-top: 16px; border: 1px solid transparent; border-radius: 2px 0 0 2px; box-sizing: border-box; -moz-box-sizing: border-box; height: 32px; outline: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
remove hard coded width div class="main". says 100% because of horizontal scroll bar appears on page overrides width set col-md-9 of bootstrap. hope u asking.
Comments
Post a Comment