jquery - Div inside custom scrollbar content does not work properply -


i inserted div (.test) custom scrollbar plugin. default, width , height 100%.

html

 <div class="container default-skin">      <div class="test">asdasd</div>  </div> 

css

.container { position:absolute; width:100%; height:100%; top:0; box-sizing: border-box; overflow: hidden; } .test { float:left; width: 100%; height:1500px; background:red; } 

problem consists of several elements.

a) .test div not working properply percentages, works pixels.

b) if using position:absolute in .test div, scrollbar content disappears.

c) similar problems percentages or positioning in div.

my question:

how can fix problems? want put .test div center of page. that, need float , margins options (they not working). also, in future use percentages, so, how can avoid problems in future?

i created demo in jsfiddle. check it

first, think have layout positioning issue , that's why scrollbars messed up. without knowing intrinsics of scrollbar plugin or without reverse engineering scrollbar plugin, i'd cast votes layout issues have.

the issue if position .test div absolute inside div absolute position without dimension specified (height , width) can't expect .test div work percentages because parent element (.overview) positioned absolute no dimensions specified. so, think it's worth remember absolute position means. quote w3schools...

an absolute position element positioned relative first parent element has position other static. if no such element found, containing block html element

so, currently, if set .test absolute position width 0 (zero) while .overview (its parent) has 0 width , 0 height. understood? 0 height , 0 width...which means there no content vertically overflowing , therefore, scrollbar plugin understands there's no need display vertical scrollbars...because there no content vertically overflowing.

i hope makes sense


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -