html - How to fix the absolute position issue? -


i have question regarding absolute position div.

i have like

<div id='body-container'>     <div id='content-wrapper'>         contents....     </div> </div> 

i need make body-wrapper absolute position because of other issues.

my css

#body-container{     position: absolute;     right: 0;     left: 0;     height: 100%;     overflow-y: hidden; } 

i have encounter problem. inside content-wrapper, have dynamic contents added inside. create unwanted scrollbar , div become scrollable in div. there anyway kill scrolling behavior? much.

remove height property #body-container, , fit content's height. no scrollbar.

http://jsfiddle.net/qefe5/

edit

if need wrapper full height, don't forget set top: 0 property, body won't create scroll:

#body-container{     position: absolute;     right: 0;     left: 0;     top: 0;     background: silver;     height: 100%;     overflow: hidden; } 

updated: http://jsfiddle.net/qefe5/1/


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -