css - bootstrap, grid and scrolling -
i'm using bootstrap, angular , angular-ui-router
what want achieve mockup:
where menu on left navigation bar, toolbar on top, breadcrumbs, content , footer.
i can these elements in place. however, need populate content variable number of elements rest data source. want wrap these nicely, using following angular / html
<div class="col-lg-12 "> <div class="row"> <div class="col-md-4 " ng-repeat-start="item in $ctrl.items"> <div> card details here </div> <div class="clearfix" ng-if="$index % 3 === 2"></div> <div ng-repeat-end=""></div> </div> </div> </div>
this works, , shows data. however, there more data can fit div, scrollbars appear on window
what acheive scrollbar appear in content div , screenshot
i have tried sorts of css, overflow: scroll-y
, can't figure out.
your problem seems related dynamic heights
. using fixed heights
(also %, vh, ... useable), can layout work properly. there lot of solutions that.
1. using %
if you're going use %, , far best option, have start @ root tag <html>
. after you've add proper height value it's child elements want use. keep in mind start @ 100%
, shrink child element desired heights.
2. using vh
the vh value kinda same %. don't need set height every parent element. demo
note: may have check if that's working target browser.
3. css3 calc() function
propably newest method. can calculate values through css(3), using e.g. calc(100% - 100px)
. that's pretty cool though, isn't supported every browser. see here.
4. fixed layout
you use fixed positionings. setting footer, header , nav position: fixed;
keep smooth , clean. i'd use fixed layout in order done, since i'd most. doesn't have incompatibility legacy browsers.
Comments
Post a Comment