html - How to scroll content within fixed wrapper using native browser scroll -


easiest (i hope) check out here: http://jsfiddle.net/ug7un/

there fixed wrapper covers whole page 20px margin. how content scroll within wrapper?

<div id="wrap"> <div id="content">     <p>how can scroll within white content area only, using native browser scroll?</p> </div> <div id="photo"></div> </div>  html {     background:url(http://i1210.photobucket.com/albums/cc406/ingutuks/2012/p5211369.jpg) no-repeat center center fixed;      background-size:cover;     }  #wrap {     background:#fff;     margin:20px;     position:fixed;     overflow:hidden; }  #content {     width:45%;     padding:2.5%;    float:left; }  #photo {     width:50%;     background:url(http://i1351.photobucket.com/albums/p790/krazykobrarawr/jojothecat_zps448af247.jpg) no-repeat center center;     background-size:cover;     float:right; } 

if understand correctly can use overflow:auto; in wrap div.

#wrap {     background:#fff;     margin:20px;     position:fixed;     overflow:auto; } 

it show scroller in wrap div.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -