我有三个div我需要标题和left_side div来修复和内容div滚动.我一直在寻找解决方案,发现有溢出和位置的东西.但我不能使用它的核心.我该怎么做?我会感谢各种答案.
HTML ------ <div id="header"> </div> <div id="left_side"> </div> <div id="content"> </div CSS ----- body { width: 100%; height: auto; padding: 0; margin: 0px auto; font-family: Calibri,Georgia,Ubuntu-C; font-size: 16px; margin-bottom: 20PX } #header{ width: 100%; height: 139px; background-image: url('images/Header_grey.gif'); } #left_side{ width: 210px; height: 700px; background-image: url('images/Left_side.gif'); background-repeat:repeat-y; overflow:hidden; position:absolute; font-size: 16px; } #content{ height: auto; padding: 20px; margin-left: 230px; margin-right: 20px; padding-bottom: 30px }
解决方法
溢出:自动;需要时添加滚动条
#header{ width: 100%; height: 139px; background-image: url('images/Header_grey.gif'); overflow: hidden; //code added to prevent scroll } #left_side{ width: 210px; height: 700px; background-image: url('images/Left_side.gif'); background-repeat:repeat-y; overflow:hidden; //code added to prevent scroll position:absolute; font-size: 16px; } #content{ height: auto; padding: 20px; margin-left: 230px; margin-right: 20px; padding-bottom: 30px; overflow: auto; //code added }